Skip to main content

TreeListNodeIterator.Current Property

Gets a node currently being processed by the TreeListNodeIterator object.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core


public TreeListNode Current { get; }

Property Value

Type Description

A TreeListNode object that is the node currently being processed.


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.


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

TreeListNodeIterator Example

View Example: Iterate Through Nodes With the TreeListNodeIterator

<dxg:GridControl x:Name="grid" 
        <dxg:TreeListView x:Name="view" AutoWidth="True"
                          KeyFieldName="ID" ParentFieldName="ParentID"/>
void SmartExpandNodes(int minChildCount) {
    TreeListNodeIterator nodeIterator = new TreeListNodeIterator(view.Nodes, true);
    while (nodeIterator.MoveNext())
        nodeIterator.Current.IsExpanded = nodeIterator.Current.Nodes.Count >= minChildCount;

void OnGridLoaded(object sender, RoutedEventArgs e) {

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Current property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also