System.Web.UI.WebControls.TreeView.Nodes Property

Gets a collection of System.Web.UI.WebControls.TreeNode objects that represents the root nodes in the System.Web.UI.WebControls.TreeView control.

Syntax

[System.ComponentModel.MergableProperty(false)]
[System.ComponentModel.DefaultValue(null)]
[System.ComponentModel.Editor("System.Web.UI.Design.WebControls.TreeNodeCollectionEditor,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public TreeNodeCollection Nodes { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the TreeView.Nodes property to get a System.Web.UI.WebControls.TreeNodeCollection object that contains all the root nodes in the tree. This collection is commonly used to quickly iterate through all the root nodes, or to access a specific root node in the tree.

Note:

A typical tree structure has only one root node; however, you can add multiple root nodes to the System.Web.UI.WebControls.TreeView control.

The TreeView.Nodes property can also be used to manage the root nodes in the tree programmatically. You can add, insert, remove, and retrieve System.Web.UI.WebControls.TreeNode objects from the collection. Any updates to the collection are automatically reflected in the System.Web.UI.WebControls.TreeView control after the next round trip to the server.

To access the child nodes of a root node, use the TreeNode.ChildNodes property of the node. Use the TreeNode.ChildNodes property of each subsequent parent-level node to navigate down the node levels.

Requirements

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