A newer version of this page is available. Switch to the current version.

TreeListNodeIterator.Current Property

Gets a node currently being processed by the TreeListNodeIterator object.

Namespace: DevExpress.Xpf.Grid

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

Declaration

public TreeListNode Current { get; }
Public ReadOnly Property Current As TreeListNode

Property Value

Type Description
TreeListNode

A TreeListNode object that is the node currently being processed.

Remarks

Use the TreeListNodeIterator.MoveNext method to iterate through the nodes. The currently processed node is returned by the Current property. Each time the TreeListNodeIterator.MoveNext method is called, the Node Iterator moves to the next node in the hierarchy and updates the Current property. If the current node is the last node, the TreeListNodeIterator.MoveNext method returns false.

To reset the Node Iterator to its initial state, call the TreeListNodeIterator.Reset method.

Examples

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>

Implements

System.Collections.Generic.IEnumerator<DevExpress.Xpf.Grid.TreeListNode>.Current
See Also