New to Telerik UI for WinForms? Start a free 30-day trial

Traverses the current node view in either direction.

When the view is sorted, a default enumerator's first MoveNext() skips the first node after construction or reset. An enumerator created with an index cannot be advanced in a sorted view and throws InvalidCastException.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class TreeNodeView.TreeNodeEnumerator : ITreeNodeEnumerator, IDisposable, IEnumerator

Inheritance: objectTreeNodeView.TreeNodeEnumerator

Implements: IDisposableIEnumeratorITreeNodeEnumerator

Constructors

Creates an enumerator positioned at an entry in the current view.

C#
public TreeNodeEnumerator(TreeNodeView items, int position)
Parameters:itemsTreeNodeView

The view to traverse.

positionint

The zero-based position to select as the current entry.

In a sorted view, calling MoveNext() or MovePrev() on the returned enumerator throws InvalidCastException.

Creates an enumerator positioned at the specified node when it is present in the current view.

C#
public TreeNodeEnumerator(TreeNodeView items, RadTreeNode node)
Parameters:itemsTreeNodeView

The view to traverse.

nodeRadTreeNode

The node to select as the current entry.

Creates an enumerator for the view's current order.

C#
public TreeNodeEnumerator(TreeNodeView items)
Parameters:itemsTreeNodeView

The view to traverse.

In a sorted view, the first call to MoveNext() advances past the first node.

Properties

Gets the current node, or null when the enumerator has no current entry.

C#
public RadTreeNode Current { get; }

Methods

Releases the references held by this enumerator.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Advances to the next node in the current view.

C#
public bool MoveNext()
Returns:

bool

true if a next node exists; otherwise, false.

Implements: IEnumerator.MoveNext()

Moves to the previous node in the current view.

C#
public bool MovePrev()
Returns:

bool

true if a previous node exists; otherwise, false.

Implements: ITreeNodeEnumerator.MovePrev()

Resets the enumerator's traversal state.

C#
public void Reset()

Implements: IEnumerator.Reset()

In a sorted view, the next MoveNext() advances past the first node.