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

Base class for indexes that expose a collection view's current filtered and sorted item sequence.

Definition

Namespace:Telerik.Collections.Generic

Assembly:Telerik.WinControls.dll

Type Parameters:

T

The data-item type stored by the index.

Syntax:

C#
public abstract class Index<T> : IReadOnlyCollection<T>, IEnumerable where T : IDataItem

Inheritance: objectIndex<T>

Derived Classes: AvlIndex<T>HybridIndex<T>ListIndex<T>RBTreeIndex<T>

Implements: IEnumerableIReadOnlyCollection<T>

Constructors

Initializes an index for the specified collection view.

C#
public Index(RadCollectionView<T> collectionView)
Parameters:collectionViewRadCollectionView<T>

The view whose source, filtering, sorting, and paging settings drive the index.

Properties

Gets the collection view that supplies this index's source and operation settings.

C#
public RadCollectionView<T> CollectionView { get; }

Gets the number of items in the current indexed projection.

C#
public int Count { get; }

Implements: IReadOnlyCollection<T>.Count

Items

IList<T>

Gets the items in the index's current projection.

C#
public abstract IList<T> Items { get; }

Gets the item at the specified index in the current projection.

C#
public T this[int index] { get; }
Parameters:indexint

Implements: IReadOnlyCollection<T>.this[int]

Methods

Determines whether the current projection contains the specified item.

C#
public bool Contains(T value)
Parameters:valueT

The item to locate.

Returns:

bool

true if the item is present; otherwise, false.

Implements: IReadOnlyCollection<T>.Contains(T)

Copies the indexed items into an array beginning at the specified destination index.

C#
public void CopyTo(T[] array, int index)
Parameters:arrayT[]

The destination array.

indexint

The zero-based destination index.

Implements: IReadOnlyCollection<T>.CopyTo(T[], int)

Enumerates the items in the current indexed projection.

C#
public IEnumerator<T> GetEnumerator()
Returns:

IEnumerator<T>

An enumerator over the indexed items.

Calculates the page number by dividing the item's current index by the view's page size.

C#
public virtual int GetItemPageIndex(T item)
Parameters:itemT

The item whose page is requested.

Returns:

int

The zero-based page index calculated for the item.

Copies the requested page from the indexed item sequence.

C#
public virtual IList<T> GetItemsOnPage(int pageIndex)
Parameters:pageIndexint

The zero-based page index.

Returns:

IList<T>

A list containing the items in that page, up to the view's page size.

Finds the position of an item in the current indexed projection.

C#
public int IndexOf(T value)
Parameters:valueT

The item to locate.

Returns:

int

The zero-based index, or -1 if the item is not present.

Implements: IReadOnlyCollection<T>.IndexOf(T)

Provides a hook for concrete indexes to replace their source sequence.

C#
public virtual void Load(IEnumerable<T> source)
Parameters:sourceIEnumerable<T>

The sequence to load.

Rebuilds the indexed item sequence to reflect the associated view.

C#
protected abstract void Perform()

Provides a hook for concrete indexes to adjust their cached version marker when a view is marked dirty.

C#
protected virtual void SetDirty()