System.Web.UI.WebControls.TreeNodeBinding.Depth Property

Gets or sets the node depth at which the System.Web.UI.WebControls.TreeNodeBinding object is applied.

Syntax

[System.ComponentModel.DefaultValue(-1)]
public int Depth { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

A node depth specifies the node level that gets bound. For example, the following System.Web.UI.WebControls.TreeNodeBinding declaration binds the Name and ID fields of the data source to the TreeNode.Text and TreeNode.Value properties, respectively, of all nodes with a depth of 0:

Example

<asp:TreeNodeBinding Depth="0" TextField="Name" ValueField="ID">

When creating a System.Web.UI.WebControls.TreeNodeBinding object, you must specify the criteria for binding. The criteria indicates when a data item should be bound to a node. You can specify the TreeNodeBinding.Depth or TreeNodeBinding.DataMember property, or both properties. There is a slight performance gain by specifying both.

Once the binding criteria is established, you can then bind a property of a System.Web.UI.WebControls.TreeNode object that can be bound to a value. You can bind to a field of a data item or to a static value. When bound to a static value, all System.Web.UI.WebControls.TreeNode objects to which the System.Web.UI.WebControls.TreeNodeBinding object is applied share the same value.

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