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

Exposes the filtered, sorted, and grouped projection of a data-item collection, with change notifications and current-item navigation.

Definition

Namespace:Telerik.WinControls.Data

Assembly:Telerik.WinControls.dll

Type Parameters:

T

The data-item type shown by the view.

Syntax:

C#
public interface ICollectionView<T> where T : IDataItem

Properties

Indicates whether the view can apply its item filter.

C#
bool CanFilter { get; }

Indicates whether the view can group items.

C#
bool CanGroup { get; }

Indicates whether the view can sort items.

C#
bool CanSort { get; }

Gets the item designated as current by the view, or the type's default value when there is no current item.

C#
T CurrentItem { get; }

Gets the zero-based position of the current item in the view, or -1 when there is no current item.

C#
int CurrentPosition { get; }

Gets or sets the predicate used to include items in the view.

C#
Predicate<T> Filter { get; set; }

GroupComparer

IComparer<Group<T>>

Gets or sets the comparer that orders groups in the view.

C#
IComparer<Group<T>> GroupComparer { get; set; }

Gets the rules that define the view's group hierarchy.

C#
GroupDescriptorCollection GroupDescriptors { get; }

Gets the top-level groups produced by the view.

C#
GroupCollection<T> Groups { get; }

Gets the ordered sort rules applied to the source items.

C#
SortDescriptorCollection SortDescriptors { get; }

SourceCollection

IEnumerable<T>

Gets the underlying sequence from which the view is built.

C#
IEnumerable<T> SourceCollection { get; }

Methods

Attempts to make the specified item current.

C#
bool MoveCurrentTo(T item)
Parameters:itemT

The item to make current.

Returns:

bool

true if the view accepted the change; otherwise, false.

Attempts to make the first item in the view current.

C#
bool MoveCurrentToFirst()
Returns:

bool

true if the view accepted the change; otherwise, false.

Attempts to make the last item in the view current.

C#
bool MoveCurrentToLast()
Returns:

bool

true if the view accepted the change; otherwise, false.

Attempts to make the item following the current item current.

C#
bool MoveCurrentToNext()
Returns:

bool

true if the view accepted the change; otherwise, false.

Attempts to make the item at the specified view position current.

C#
bool MoveCurrentToPosition(int position)
Parameters:positionint

The zero-based position in the view.

Returns:

bool

true if the view accepted the change; otherwise, false.

Attempts to make the item preceding the current item current.

C#
bool MoveCurrentToPrevious()
Returns:

bool

true if the view accepted the change; otherwise, false.

Refreshes the projected view after changes to its source or descriptors.

C#
void Refresh()

Events

Occurs when the items or ordering exposed by the view change.

C#
event NotifyCollectionChangedEventHandler CollectionChanged

Occurs after the current item or position changes.

C#
event EventHandler CurrentChanged

Occurs before the current item or position changes; a handler can cancel the change.

C#
event CancelEventHandler CurrentChanging