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

Enumerates property-grid items in display order, optionally including children of collapsed items.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class PropertyGridTraverser : ITraverser<PropertyGridItemBase>, IDisposable, IEnumerator, IEnumerable

Inheritance: objectPropertyGridTraverser

Implements: IDisposableIEnumerableIEnumeratorITraverser<PropertyGridItemBase>

Constructors

Creates a traverser for the items displayed by the specified table element.

C#
public PropertyGridTraverser(PropertyGridTableElement propertyGridElement)
Parameters:propertyGridElementPropertyGridTableElement

The table element whose item view is traversed.

Properties

Gets the item at the current traversal position.

C#
public PropertyGridItemBase Current { get; }
Property Value:

The current item, or null before positioning or after Reset().

Controls whether forward traversal descends into children of collapsed items and groups.

C#
public bool TraverseHirarchy { get; set; }
Property Value:

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.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Returns the cached enumerator positioned from this traverser's current state.

C#
public IEnumerator GetEnumerator()
Returns:

IEnumerator

The same enumerator instance on subsequent calls, repositioned to the current traversal state.

Implements: IEnumerable.GetEnumerator()

Gets the traversal index of an item without changing the current traversal position.

C#
public int GetIndex(PropertyGridItemBase item)
Parameters:itemPropertyGridItemBase

The item whose traversal index is requested.

Returns:

int

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.

C#
protected virtual PropertyGridItemBase GetLastChild(PropertyGridItemBase currentItem)
Parameters:currentItemPropertyGridItemBase

The item whose expanded child branch is followed.

Returns:

PropertyGridItemBase

The item at the end of that branch, or currentItem when it has no expanded children.

Moves to the next item accepted by Traversing.

C#
public bool MoveNext()
Returns:

bool

true if a next item was reached; otherwise, false.

Implements: IEnumerator.MoveNext()

Performs one forward traversal step from the current item or group, starting at the first item when unpositioned.

C#
protected virtual bool MoveNextCore()
Returns:

bool

true if a next position was found; otherwise, false.

Advances through child items, siblings, parent levels, or the next group to find the next traversal position.

C#
protected virtual bool MoveNextFromDataItem(PropertyGridItemBase currentItem, bool checkIfExpandable, bool resetIndex)
Parameters:currentItemPropertyGridItemBase

The item at the current position.

checkIfExpandablebool

Whether to descend into the current item's children before checking siblings.

resetIndexbool

Whether to recalculate the current item's index in its parent collection.

Returns:

bool

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.

C#
protected virtual bool MoveNextFromGroupItem(PropertyGridGroupItem currentGroup)
Parameters:currentGroupPropertyGridGroupItem

The group at the current position.

Returns:

bool

true if another position was found; otherwise, false.

Moves backward, continuing past items rejected by Traversing.

C#
public bool MovePrevious()
Returns:

bool

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: ITraverser<PropertyGridItemBase>.MovePrevious()

Performs one backward traversal step from the current item or group.

C#
protected virtual bool MovePreviousCore()
Returns:

bool

true if a preceding position was found or the traverser was reset at the beginning; otherwise, false.

Moves to a previous sibling, parent, or group header, following an expanded previous item's last child branch when applicable.

C#
protected virtual bool MovePreviousFromDataItem(PropertyGridItemBase currentItem)
Parameters:currentItemPropertyGridItemBase

The item at the current position.

Returns:

bool

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.

C#
protected virtual bool MovePreviousFromGroupItem(PropertyGridGroupItem currentGroup)
Parameters:currentGroupPropertyGridGroupItem

The group at the current position.

Returns:

bool

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.

C#
public void MoveTo(int index)
Parameters:indexint

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.

C#
public int MoveTo(PropertyGridItemBase item)
Parameters:itemPropertyGridItemBase

The item to locate.

Returns:

int

The item's zero-based traversal index, or -1 if the item is not reached.

Advances until no next item is available.

C#
public bool MoveToEnd()
Returns:

bool

Always true; the current position remains at the last position reached, or null if none was available.

Implements: ITraverser<PropertyGridItemBase>.MoveToEnd()

Positions the traverser at the first group or root item in the view.

C#
public bool MoveToFirst()
Returns:

bool

true if the view contains a group or root item; otherwise, false.

Creates event data for the current item, raises Traversing, and returns its processing decision.

C#
protected bool OnTraversing()
Returns:

bool

true when the current item is processed; otherwise, false.

Raises Traversing so subscribers can decide whether the item is processed.

C#
protected virtual void OnTraversing(PropertyGridTraversingEventArgs e)
Parameters:ePropertyGridTraversingEventArgs

The item and mutable processing decision.

Clears the current item and group and resets their indices.

C#
public void Reset()

Implements: IEnumerator.Reset()

Events

Occurs when the traverser reaches an item, allowing subscribers to include or skip it.

C#
public event PropertyGridTraversingEventHandler Traversing