New to Telerik UI for WinFormsStart a free 30-day trial

A traverser that extends ItemsTraverser<T> to optionally prepend a CheckAllDataItem before the regular collection items. When CheckAll is enabled, position 0 represents the CheckAllItem and all collection items are shifted by one (position N maps to Collection[N-1]).

Definition

Constructors

Initializes a new instance of the CheckedItemTraverser class.

C#
public CheckedItemTraverser(IList<RadListDataItem> collection, CheckAllDataItem checkAllItem, bool checkAll)
Parameters:collectionIList<RadListDataItem>

The collection of data items to traverse.

checkAllItemCheckAllDataItem

The CheckAll item to prepend when checkAll is true.

checkAllbool

Whether the CheckAll item should be included in the traversal.

Properties

Gets or sets a value indicating whether the CheckAllItem is included as the first item in the traversal sequence.

C#
public bool CheckAll { get; set; }

Gets or sets the CheckAllDataItem that is prepended to the traversal sequence when CheckAll is enabled.

C#
public CheckAllDataItem CheckAllItem { get; set; }

Methods

Returns an enumerator that iterates through the traversal sequence starting from the current position. The enumerator state is synchronized using the internal position and current item directly, bypassing the base Position setter which cannot represent the CheckAllItem.

C#
public override IEnumerator GetEnumerator()
Returns:

IEnumerator

An IEnumerator for the traversal sequence.

Overrides: ItemsTraverser<RadListDataItem>.GetEnumerator()

Moves the traverser one position forward. When CheckAll is enabled, the first call from the reset state (position -1) yields the CheckAllItem at position 0. Subsequent calls yield Collection[position - 1]. Returns false when all items have been visited.

C#
protected override bool MoveNextCore()
Returns:

bool

true if the traverser successfully moved to the next item; false if the end was reached.

Overrides: ItemsTraverser<RadListDataItem>.MoveNextCore()

Moves the traverser one position backward. When CheckAll is enabled, position 0 maps to the CheckAllItem and positions above 0 map to Collection[position - 1]. Returns false when there are no more items.

C#
protected override bool MovePreviousCore()
Returns:

bool

true if the traverser successfully moved to the previous item; false if the beginning was reached.

Overrides: ItemsTraverser<RadListDataItem>.MovePreviousCore()