Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Concepts
    [Expand]Binding to Data
    [Collapse]Data Representation Basics
     [Expand]Columns
     [Collapse]Nodes
       Expanding and Collapsing Nodes
       Using the Node Iterator
       Preview
      Tree Generation Algorithm in the ASPxTreeList
    [Expand]Data Editing
    [Expand]Data Shaping and Manipulation
     Drag and Drop
    [Expand]Focus and Navigation
     Appearance Customization
     Save and Restore Layout
    [Expand]Templates
     Toolbars
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Card View
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Using the Node Iterator

The ASPxTreeList introduces the Node Iterator, which allows you to traverse through the nodes and avoid writing recursive code.

To use the Node Iterator you should create a new instance of the TreeListNodeIterator object. A start node is specified within the constructor.

To start traversing from the root node, pass the ASPxTreeList.RootNode as a parameter.

You can also use the ASPxTreeList.CreateNodeIterator method to create the Nodes Iterator.

The current node is returned by the TreeListNodeIterator.Current property. To obtain the next node, use the TreeListNodeIterator.GetNext method.

To return the Node Iterator to its default state, call the TreeListNodeIterator.Reset method.

Expanded Example

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.

Is this topic helpful?​​​​​​​