Enumerates property-grid items in display order, optionally including children of collapsed items.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class PropertyGridTraverser : ITraverser<PropertyGridItemBase>, IDisposable, IEnumerator, IEnumerable
Inheritance: objectPropertyGridTraverser
Implements:
Constructors
Creates a traverser for the items displayed by the specified table element.
public PropertyGridTraverser(PropertyGridTableElement propertyGridElement)
The table element whose item view is traversed.
Properties
Controls whether forward traversal descends into children of collapsed items and groups.
public bool TraverseHirarchy { get; set; }
true to allow forward traversal through collapsed items; otherwise, only expanded branches are traversed.
Backward traversal does not consistently descend through children of collapsed items.
Methods
Performs no cleanup; the traverser holds no disposable resources.
public void Dispose()
Implements:
Returns the cached enumerator positioned from this traverser's current state.
public IEnumerator GetEnumerator()
The same enumerator instance on subsequent calls, repositioned to the current traversal state.
Implements:
Gets the traversal index of an item without changing the current traversal position.
public int GetIndex(PropertyGridItemBase item)
The item whose traversal index is requested.
Returns:The item's zero-based traversal index, or -1 if the item is not reached.
Returns the deepest last child reached by following expanded items from the specified item.
protected virtual PropertyGridItemBase GetLastChild(PropertyGridItemBase currentItem)
The item whose expanded child branch is followed.
Returns:The item at the end of that branch, or currentItem when it has no expanded children.
Moves to the next item accepted by Traversing.
Advances through child items, siblings, parent levels, or the next group to find the next traversal position.
protected virtual bool MoveNextFromDataItem(PropertyGridItemBase currentItem, bool checkIfExpandable, bool resetIndex)
The item at the current position.
checkIfExpandableboolWhether to descend into the current item's children before checking siblings.
resetIndexboolWhether to recalculate the current item's index in its parent collection.
Returns:true if another data item or group header was found; otherwise, false.
Advances from a group into its first item when allowed, or to the next group.
protected virtual bool MoveNextFromGroupItem(PropertyGridGroupItem currentGroup)
The group at the current position.
Returns:Moves backward, continuing past items rejected by Traversing.
public bool MovePrevious()
true when a backward step is accepted. Moving before the first item resets the cursor and raises Traversing with a null item, so that event's Process value determines the result.
Implements:
Moves to a previous sibling, parent, or group header, following an expanded previous item's last child branch when applicable.
protected virtual bool MovePreviousFromDataItem(PropertyGridItemBase currentItem)
The item at the current position.
Returns:true if a preceding position was found or the traverser was reset before the first root item; otherwise, false.
Moves to the previous group or to that group's last item branch.
protected virtual bool MovePreviousFromGroupItem(PropertyGridGroupItem currentGroup)
The group at the current position.
Returns:true if another position was found or the traverser was reset at the first group; otherwise, false.
Resets the traverser and advances while incrementing the supplied loop value; zero only resets, positive values traverse to the end, and negative values advance toward zero.
public void MoveTo(int index)
The loop value; this overload does not reliably position the traverser at a zero-based index.
Resets the traverser and searches the traversal sequence for the specified item.
public int MoveTo(PropertyGridItemBase item)
The item to locate.
Returns:The item's zero-based traversal index, or -1 if the item is not reached.
Creates event data for the current item, raises Traversing, and returns its processing decision.
Raises Traversing so subscribers can decide whether the item is processed.
protected virtual void OnTraversing(PropertyGridTraversingEventArgs e)
The item and mutable processing decision.
Clears the current item and group and resets their indices.
public void Reset()
Implements:
Events
Occurs when the traverser reaches an item, allowing subscribers to include or skip it.
public event PropertyGridTraversingEventHandler Traversing