Skip to main content
A newer version of this page is available. .

TreeListNodeIterator Class

The Node Iterator.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v19.1.dll

Declaration

public class TreeListNodeIterator :
    IEnumerator<TreeListNode>,
    IDisposable,
    IEnumerator,
    IEnumerable<TreeListNode>,
    IEnumerable

Remarks

The Node Iterator allows you to traverse through the nodes without writing recursive code. Nodes are visited one by one, starting from a specified node down to the last node contained within a tree.

To iterate through the nodes, do the following.

To learn more, see Iterating Through Nodes.

Example

This example shows how to traverse through all visible nodes to expand those nodes that have more than four child nodes. Nodes that have less than four child nodes are collapsed.

<Window xmlns:dxg="clr-namespace:DevExpress.Xpf.Grid;assembly=DevExpress.Xpf.Grid.v11.1"  x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
        dx:ThemeManager.ThemeName="Office2007Black"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxg:GridControl Name="grid" Loaded="grid_Loaded">
            <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="Name"/>
                <dxg:GridColumn FieldName="Department"/>
                <dxg:GridColumn FieldName="Position"/>
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TreeListView Name="treeListView" AutoWidth="True"
                                  KeyFieldName="ID" ParentFieldName="ParentID"/>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>

Inheritance

Object
TreeListNodeIterator
See Also