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

Traverses the items in a list view, respecting grouping, visibility, and the Traversing event.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class ListViewTraverser : ITraverser<ListViewDataItem>, IDisposable, IEnumerator, IEnumerable

Inheritance: objectListViewTraverser

Implements: IDisposableIEnumerableIEnumeratorITraverser<ListViewDataItem>

Constructors

Initializes a traverser for the specified list-view element.

C#
public ListViewTraverser(RadListViewElement owner)
Parameters:ownerRadListViewElement

The list-view element whose items and groups are traversed.

Properties

Gets the current item, which can be a group header when grouped traversal is active.

C#
public ListViewDataItem Current { get; }

Gets whether traversal follows the active groups instead of the flat item collection.

C#
public bool IsGroupingEnabled { get; }

Gets or sets the current traversal position; setting it to null resets traversal to the beginning.

C#
public object Position { get; set; }

Implements: ITraverser<ListViewDataItem>.Position

Methods

Does nothing because the traverser holds no disposable resources.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Creates a separate traverser initialized at the current position.

C#
public IEnumerator GetEnumerator()
Returns:

IEnumerator

A new traverser with a copy of this traverser's position.

Implements: IEnumerable.GetEnumerator()

Advances to the next eligible item.

C#
public bool MoveNext()
Returns:

bool

true if an eligible item was reached; otherwise, false.

Implements: IEnumerator.MoveNext()

Advances the cursor to the next structural candidate before event filtering.

C#
protected virtual bool MoveNextCore()
Returns:

bool

true if a candidate was found; otherwise, false.

Advances to the previous eligible item.

C#
public bool MovePrevious()
Returns:

bool

true if an eligible item was reached; otherwise, false.

Implements: ITraverser<ListViewDataItem>.MovePrevious()

Advances the cursor to the previous structural candidate before event filtering.

C#
protected virtual bool MovePreviousCore()
Returns:

bool

true if a candidate was found; otherwise, false.

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

Moves to an item and returns its zero-based index among eligible items.

C#
public int MoveTo(ListViewDataItem item)
Parameters:itemListViewDataItem

The item to locate.

Returns:

int

The item's index, or -1 if it is not reached during traversal.

Advances through the remaining eligible items to the end of the sequence.

C#
public bool MoveToEnd()
Returns:

bool

true if at least one eligible item was reached; otherwise, false.

Implements: ITraverser<ListViewDataItem>.MoveToEnd()

Determines whether the current candidate should be returned by traversal.

C#
protected virtual bool OnTraversing()
Returns:

bool

true if the candidate passes visibility, group, and event filtering.

Raises Traversing for a candidate item.

C#
protected virtual void OnTraversing(ListViewTraversingEventArgs e)
Parameters:eListViewTraversingEventArgs

The candidate item and its processing flag.

Resets the traversal position so the next move starts at the beginning.

C#
public void Reset()

Implements: IEnumerator.Reset()

Updates the internal group and item indices for the specified position.

C#
protected virtual void SetPositionCore(object value)
Parameters:valueobject

The position whose indices are calculated.

Events

Occurs for each candidate item that passes visibility and collapsed-group checks.

C#
public event ListViewTraversingEventHandler Traversing