TreeViewTraverser
Traverses visible tree nodes in hierarchy order, descending into children only when their parent is expanded. Invisible nodes are included while the tree is in design mode.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class TreeViewTraverser : ITraverser<RadTreeNode>, IDisposable, IEnumerator, IEnumerable
Inheritance: objectTreeViewTraverser
Implements:
Constructors
Creates a traverser for the specified tree view and positions it at the supplied node.
public TreeViewTraverser(RadTreeViewElement owner, RadTreeNode position)
The tree element whose nodes are traversed.
positionRadTreeNodeThe initial node position.
Creates a traverser for the specified tree view.
public TreeViewTraverser(RadTreeViewElement owner)
The tree element whose nodes are traversed.
Properties
Gets the node at the current traversal position.
public RadTreeNode Current { get; }
The current node, or null when traversal has no position.
Gets or sets the node at the current traversal position.
public object Position { get; set; }
The current RadTreeNode, or null when no node is positioned.
Implements:
Methods
Performs no cleanup; this traverser does not release resources or clear its node references.
public void Dispose()
Implements:
Gets the cached enumerator positioned at this traverser's current node. Repeated calls reuse the same enumerator instance.
public IEnumerator GetEnumerator()
The cached tree-node enumerator.
Implements:
Searches backward from the current position, including the current node, for the specified node.
Searches forward from the current position, including the current node, for the specified node.
Advances to the next visible node in hierarchy order, descending into children of expanded nodes. Nodes rejected by Traversing are skipped.
Advances the internal position to the next visible node without raising Traversing.
Advances the internal position to the preceding visible node without raising Traversing.
Resets traversal and returns the zero-based position of the specified node among nodes accepted by Traversing.
public int MoveTo(RadTreeNode item)
The node to locate.
Returns:The node's position, or -1 if it is not reached.
Moves to the last root node accepted by Traversing, searching the root collection from end to beginning. This operation does not descend into child nodes.
Raises the Traversing event with the supplied event data.
protected virtual void OnTraversing(TreeViewTraversingEventArgs e)
The candidate node and its processing flag.
Resets traversal so the next move starts at the first root node.
public void Reset()
Implements:
Events
Occurs for each candidate node before traversal returns it. Set Process to false to skip that node.
public event TreeViewTraversingEventHandler Traversing