System.Web.UI.WebControls.TreeNodeBinding.ValueField Property

Gets or sets the name of the field from the data source to bind to the TreeNode.Value property of a System.Web.UI.WebControls.TreeNode object to which the System.Web.UI.WebControls.TreeNodeBinding object is applied.

Syntax

[System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.DefaultValue("")]
public string ValueField { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the System.Web.UI.WebControls.TreeView control is bound to a data source, use the TreeNodeBinding.ValueField property to specify the field name to bind to the TreeNode.Value property of a System.Web.UI.WebControls.TreeNode object. This binding relationship affects all System.Web.UI.WebControls.TreeNode objects to which the System.Web.UI.WebControls.TreeNodeBinding object is applied. The TreeNode.Value property is used to supplement the TreeNode.Text property by storing any additional data associated with the node to which the System.Web.UI.WebControls.TreeNodeBinding object is applied. This value is not displayed in the control and is commonly used to store data for handling postback events.

Note:

You can selectively override the TreeNodeBinding.ValueField property by setting the TreeNode.Value property of each node directly.

Instead of using the TreeNodeBinding.ValueField property to bind the TreeNode.Value property of a System.Web.UI.WebControls.TreeNode object to an field, you can set the TreeNode.Value property to a fixed value by setting the TreeNodeBinding.Value property.

Note:

If the data source contains multiple fields, you must first set the TreeNodeBinding.Depth or TreeNodeBinding.DataMember property, or both properties in order to bind to the appropriate field.

The value of this property is stored in view state.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0