Skip to main content

TreeViewNode.Nodes Property

Gets the collection of child nodes within the particular node and provides indexed access to them.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.2.dll

NuGet Package: DevExpress.Web


public TreeViewNodeCollection Nodes { get; }

Property Value

Type Description

A TreeViewNodeCollection object representing the collection of the child nodes.


Use the Nodes property to access the collection of child nodes of the current node. This collection contains only the nodes at the next level. To access nodes further down the ASPxTreeView, use the Nodes property of a child node. If the Nodes property is the null reference (Nothing in Visual Basic), the current node does not have any child nodes. A particular node can be accessed using index notation.

Note that the nodes of an ASPxTreeView’s root node can be accessed via the ASPxTreeView.Nodes property of the ASPxTreeView control.


The code below demonstrates how you can implement recursive tree traversal, to execute a specific action for each node.

protected void PerformActionOnNodesRecursive(TreeViewNodeCollection nodes, Action<TreeViewNode> action) {
        foreach (TreeViewNode node in nodes) {
            if (node.Nodes.Count > 0)
                PerformActionOnNodesRecursive(node.Nodes, action);
See Also