Skip to main content

How to: Use the Nodes Iterator

This example shows how to collect the key values of all parent nodes displayed within the ASPxTreeList. The TreeListNodeIterator object is used to traverse through the nodes.

using System.Collections.Generic;
using DevExpress.Web.ASPxTreeList;

List<string> nodeKeys;
void ProcessNodes(TreeListNode startNode) {
    if (startNode == null) return;
    TreeListNodeIterator iterator = new TreeListNodeIterator(startNode);
    nodeKeys = new List<string>();
    while (iterator.Current != null) {

private void GetParentNodeKey(TreeListNode node) {
    if (node != treeList.RootNode && node.HasChildren)