Class
RadCollectionView<TDataItem>

Provides an abstract base class for collection views that support filtering, sorting, grouping, and paging operations on strongly-typed data item collections.

Definition

Namespace:Telerik.WinControls.Data

Assembly:Telerik.WinControls.dll

Type Parameters:

TDataItem

The type of data items in the collection, which must implement IDataItem.

Syntax:

cs-api-definition
public abstract class RadCollectionView<TDataItem> : ICollectionView<TDataItem>, IPagedCollectionView, IReadOnlyCollection<TDataItem>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged where TDataItem : IDataItem

Inheritance: objectRadCollectionView<TDataItem>

Derived Classes: RadDataView<TDataItem>

Implements: ICollectionView<TDataItem>IEnumerableINotifyCollectionChangedINotifyPropertyChangedIPagedCollectionViewIReadOnlyCollection<TDataItem>

Constructors

RadCollectionView(IEnumerable<TDataItem>)

Declaration

cs-api-definition
public RadCollectionView(IEnumerable<TDataItem> collection)

Parameters

collection

IEnumerable<TDataItem>

Properties

BypassFilter

Gets or sets a value indicating whether filtering will be performed or it will be handled by the user/data source.

Declaration

cs-api-definition
[Browsable(false)]
public bool BypassFilter { get; set; }

Property Value

bool

BypassSort

Gets or sets a value indicating whether sorting will be performed or it will be handled by the user/data source.

Declaration

cs-api-definition
[Browsable(false)]
public bool BypassSort { get; set; }

Property Value

bool

CanChangePage

Gets a value that indicates whether the IPagedCollectionView.PageIndex value is allowed to change.

Declaration

cs-api-definition
public virtual bool CanChangePage { get; }

Property Value

bool

true if the IPagedCollectionView.PageIndex value is allowed to change; otherwise, false.

Implements IPagedCollectionView.CanChangePage

CanFilter

Gets or sets a value indicating whether this data view can filter.

Declaration

cs-api-definition
public virtual bool CanFilter { get; set; }

Property Value

bool

true if this instance can filter; otherwise, false.

Implements ICollectionView<TDataItem>.CanFilter

CanGroup

Gets or sets a value indicating whether this data view can group.

Declaration

cs-api-definition
public virtual bool CanGroup { get; set; }

Property Value

bool

true if this instance can group; otherwise, false.

Implements ICollectionView<TDataItem>.CanGroup

CanPage

Gets or sets a value indicating whether this data view can be paginated.

Declaration

cs-api-definition
public virtual bool CanPage { get; set; }

Property Value

bool

true if this data view can be paginated; otherwise, false.

Implements IPagedCollectionView.CanPage

CanSort

Gets or sets a value indicating whether this data view can sort.

Declaration

cs-api-definition
public virtual bool CanSort { get; set; }

Property Value

bool

true if this instance can sort; otherwise, false.

Implements ICollectionView<TDataItem>.CanSort

CaseSensitive

Indicates whether string comparisons of data are case-sensitive.

Declaration

cs-api-definition
[Browsable(true)]
public bool CaseSensitive { get; set; }

Property Value

bool

ChangeCurrentOnAdd

Gets or sets a value indicating whether [change current on add].

Declaration

cs-api-definition
public bool ChangeCurrentOnAdd { get; set; }

Property Value

bool

true if [change current on add]; otherwise, false.

Comparer

Gets or sets the comparer.

Declaration

cs-api-definition
[Browsable(false)]
public virtual IComparer<TDataItem> Comparer { get; set; }

Property Value

IComparer<TDataItem>

The comparer.

Count

Gets the count.

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

The count.

Implements IReadOnlyCollection<TDataItem>.Count

CurrentItem

Gets or sets the current item.

Declaration

cs-api-definition
public TDataItem CurrentItem { get; }

Property Value

TDataItem

The current item.

Implements ICollectionView<TDataItem>.CurrentItem

CurrentPosition

Gets or sets the current position.

Declaration

cs-api-definition
public int CurrentPosition { get; protected set; }

Property Value

int

The current position.

Implements ICollectionView<TDataItem>.CurrentPosition

DefaultFilter

Default callback so that the default filtering expression parser can be substituted.

Declaration

cs-api-definition
public virtual Predicate<TDataItem> DefaultFilter { get; }

Property Value

Predicate<TDataItem>

DefaultGroupPredicate

Gets the default group predicate.

Declaration

cs-api-definition
public virtual GroupPredicate<TDataItem> DefaultGroupPredicate { get; }

Property Value

GroupPredicate<TDataItem>

The default group predicate.

Filter

Provides a callback so that the default filtering expression parser can be substituted.

Declaration

cs-api-definition
public virtual Predicate<TDataItem> Filter { get; set; }

Property Value

Predicate<TDataItem>

Implements ICollectionView<TDataItem>.Filter

FilterExpression

Gets or sets the filter expression.

Declaration

cs-api-definition
public virtual string FilterExpression { get; set; }

Property Value

string

The filter expression.

GroupComparer

Gets or sets the comparer.

Declaration

cs-api-definition
[Browsable(false)]
public virtual IComparer<Group<TDataItem>> GroupComparer { get; set; }

Property Value

IComparer<Group<TDataItem>>

The comparer.

Implements ICollectionView<TDataItem>.GroupComparer

GroupDescriptorCollectionFactory

This property is used internally.

Declaration

cs-api-definition
public IGroupDescriptorCollectionFactory GroupDescriptorCollectionFactory { get; set; }

Property Value

IGroupDescriptorCollectionFactory

GroupDescriptors

Gets the group descriptions.

Declaration

cs-api-definition
public GroupDescriptorCollection GroupDescriptors { get; }

Property Value

GroupDescriptorCollection

The group descriptions.

Implements ICollectionView<TDataItem>.GroupDescriptors

GroupFactory

Declaration

cs-api-definition
public virtual IGroupFactory<TDataItem> GroupFactory { get; set; }

Property Value

IGroupFactory<TDataItem>

GroupPredicate

Declaration

cs-api-definition
public virtual GroupPredicate<TDataItem> GroupPredicate { get; set; }

Property Value

GroupPredicate<TDataItem>

Groups

Gets the groups.

Declaration

cs-api-definition
public virtual GroupCollection<TDataItem> Groups { get; }

Property Value

GroupCollection<TDataItem>

The groups.

Implements ICollectionView<TDataItem>.Groups

HasDataOperation

Declaration

cs-api-definition
protected bool HasDataOperation { get; }

Property Value

bool

HasFilter

Gets a value indicating whether this instance has filter applied.

Declaration

cs-api-definition
protected bool HasFilter { get; }

Property Value

bool

true if this instance has filter applied; otherwise, false.

HasGroup

Gets a value indicating whether this instance has group applied.

Declaration

cs-api-definition
protected bool HasGroup { get; }

Property Value

bool

true if this instance has group applied; otherwise, false.

HasSort

Gets a value indicating whether this instance has sort applied.

Declaration

cs-api-definition
protected bool HasSort { get; }

Property Value

bool

true if this instance has sort applied; otherwise, false.

IsDynamic

Gets a value that indicates whether the underlying collection provides change notifications.

Declaration

cs-api-definition
public bool IsDynamic { get; }

Property Value

bool

true if this instance is dynamic; otherwise, false.

IsEmpty

Gets a value indicating whether this item collection is empty.

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

true if this item collection is empty; otherwise, false.

IsInUpdate

Declaration

cs-api-definition
protected bool IsInUpdate { get; }

Property Value

bool

IsIncrementalFiltering

Gets a value indicating whether this instance is incremental filtering.

Declaration

cs-api-definition
public bool IsIncrementalFiltering { get; }

Property Value

bool

true if this instance is incremental filtering; otherwise, false.

IsPageChanging

Gets a value that indicates whether a page index change is in process.

Declaration

cs-api-definition
public virtual bool IsPageChanging { get; }

Property Value

bool

true if the page index is changing; otherwise, false.

Implements IPagedCollectionView.IsPageChanging

ItemCount

Gets the total number of items in the source collection.

Declaration

cs-api-definition
public virtual int ItemCount { get; }

Property Value

int

The total number of items in the source collection, or -1 if the total number is unknown.

Implements IPagedCollectionView.ItemCount

Items

Declaration

cs-api-definition
protected virtual IList<TDataItem> Items { get; }

Property Value

IList<TDataItem>

PageIndex

Gets the zero-based index of the current page.

Declaration

cs-api-definition
public virtual int PageIndex { get; }

Property Value

int

The zero-based index of the current page.

Implements IPagedCollectionView.PageIndex

PageSize

Gets or sets the number of items to display on a page.

Declaration

cs-api-definition
public virtual int PageSize { get; set; }

Property Value

int

The number of items to display on a page.

Implements IPagedCollectionView.PageSize

PagingBeforeGrouping

Gets or sets a value indicating whether paging is performed before grouping or vice versa.

Declaration

cs-api-definition
public virtual bool PagingBeforeGrouping { get; set; }

Property Value

bool

true if paging is performed before grouping; otherwise, false.

SortDescriptorCollectionFactory

This property is used internally.

Declaration

cs-api-definition
public ISortDescriptorCollectionFactory SortDescriptorCollectionFactory { get; set; }

Property Value

ISortDescriptorCollectionFactory

SortDescriptors

Gets the sort descriptions.

Declaration

cs-api-definition
public SortDescriptorCollection SortDescriptors { get; }

Property Value

SortDescriptorCollection

The sort descriptions.

Implements ICollectionView<TDataItem>.SortDescriptors

SourceCollection

Gets the source collection.

Declaration

cs-api-definition
public virtual IEnumerable<TDataItem> SourceCollection { get; }

Property Value

IEnumerable<TDataItem>

The source collection.

Implements ICollectionView<TDataItem>.SourceCollection

TotalPages

Gets the total number of pages with the current page size.

Declaration

cs-api-definition
public virtual int TotalPages { get; }

Property Value

int

this[int]

Gets the item at the specified index.

Declaration

cs-api-definition
public TDataItem this[int index] { get; }

Parameters

index

int

Property Value

TDataItem

Implements IReadOnlyCollection<TDataItem>.this[int]

Methods

BeginUpdate()

Suspends event notification.

Declaration

cs-api-definition
public void BeginUpdate()

ClearThreadedFilterNodes()

Declaration

cs-api-definition
public void ClearThreadedFilterNodes()

Contains(TDataItem)

Determines whether [contains] [the specified item].

Declaration

cs-api-definition
public bool Contains(TDataItem item)

Parameters

item

TDataItem

The item.

Returns

bool

true if [contains] [the specified item]; otherwise, false.

Implements IReadOnlyCollection<TDataItem>.Contains(TDataItem)

ContainsGroup(Group<TDataItem>)

Determines whether the specified group is present within this view.

Declaration

cs-api-definition
public bool ContainsGroup(Group<TDataItem> group)

Parameters

group

Group<TDataItem>

Returns

bool

CopyTo(TDataItem[], int)

Copies to array.

Declaration

cs-api-definition
public void CopyTo(TDataItem[] array, int arrayIndex)

Parameters

array

TDataItem[]

The array.

arrayIndex

int

Index of the array.

DeferRefresh()

Defers the refresh.

Declaration

cs-api-definition
public virtual IDisposable DeferRefresh()

Returns

IDisposable

EndUpdate()

Resumes event notification.

Declaration

cs-api-definition
public void EndUpdate()

EndUpdate(bool)

Resumes event notification.

Declaration

cs-api-definition
public void EndUpdate(bool notifyUpdates)

Parameters

notifyUpdates

bool

EnsureDescriptors()

Declaration

cs-api-definition
public virtual void EnsureDescriptors()

EnsurePageIndex()

Ensures the index of the page is within the valid pages range.

Declaration

cs-api-definition
protected virtual void EnsurePageIndex()

Evaluate(string, IEnumerable<TDataItem>)

Evaluates the specified expression.

Declaration

cs-api-definition
public object Evaluate(string expression, IEnumerable<TDataItem> items)

Parameters

expression

string

The expression.

items

IEnumerable<TDataItem>

The items.

Returns

object

Evaluate(string, TDataItem)

Evaluates the specified expression.

Declaration

cs-api-definition
public object Evaluate(string expression, TDataItem item)

Parameters

expression

string

The expression.

item

TDataItem

The item.

Returns

object

Evaluate(string, int, int)

Evaluates the specified expression.

Declaration

cs-api-definition
public object Evaluate(string expression, int startIndex, int count)

Parameters

expression

string

The expression.

startIndex

int

The start index.

count

int

The count.

Returns

object

FilterEvaluate(FilterDescriptor, TDataItem)

Declaration

cs-api-definition
public bool FilterEvaluate(FilterDescriptor filterDescriptor, TDataItem item)

Parameters

filterDescriptor

FilterDescriptor

item

TDataItem

Returns

bool

Find(int, object)

Finds the specified item index.

Declaration

cs-api-definition
public virtual TDataItem Find(int itemIndex, object dataBoundItem)

Parameters

itemIndex

int

Index of the item.

dataBoundItem

object

The data bound item.

Returns

TDataItem

FindGroup(Group<TDataItem>)

Searches the Groups collection for a match, using the Keys in the provided group.

Declaration

cs-api-definition
public Group<TDataItem> FindGroup(Group<TDataItem> group)

Parameters

group

Group<TDataItem>

Returns

Group<TDataItem>

GetEnumerator()

Declaration

cs-api-definition
public IEnumerator<TDataItem> GetEnumerator()

Returns

IEnumerator<TDataItem>

GetFieldValue(TDataItem, string)

Declaration

cs-api-definition
protected virtual object GetFieldValue(TDataItem item, string fieldName)

Parameters

item

TDataItem

fieldName

string

Returns

object

GetItemPage(TDataItem)

Declaration

cs-api-definition
public virtual int GetItemPage(TDataItem item)

Parameters

item

TDataItem

Returns

int

IndexOf(TDataItem)

Indexes the of.

Declaration

cs-api-definition
public virtual int IndexOf(TDataItem item)

Parameters

item

TDataItem

The item.

Returns

int

Implements IReadOnlyCollection<TDataItem>.IndexOf(TDataItem)

InitializeSource(IEnumerable<TDataItem>)

Declaration

cs-api-definition
protected virtual void InitializeSource(IEnumerable<TDataItem> collection)

Parameters

collection

IEnumerable<TDataItem>

LoadData(IEnumerable<TDataItem>)

Loads the data.

Declaration

cs-api-definition
public virtual void LoadData(IEnumerable<TDataItem> collection)

Parameters

collection

IEnumerable<TDataItem>

The collection.

MoveCurrentTo(TDataItem)

Moves the current to.

Declaration

cs-api-definition
public bool MoveCurrentTo(TDataItem item)

Parameters

item

TDataItem

The item.

Returns

bool

Implements ICollectionView<TDataItem>.MoveCurrentTo(TDataItem)

MoveCurrentToFirst()

Moves the current to first.

Declaration

cs-api-definition
public bool MoveCurrentToFirst()

Returns

bool

Implements ICollectionView<TDataItem>.MoveCurrentToFirst()

MoveCurrentToLast()

Moves the current to last.

Declaration

cs-api-definition
public bool MoveCurrentToLast()

Returns

bool

Implements ICollectionView<TDataItem>.MoveCurrentToLast()

MoveCurrentToNext()

Moves the current to next.

Declaration

cs-api-definition
public bool MoveCurrentToNext()

Returns

bool

Implements ICollectionView<TDataItem>.MoveCurrentToNext()

MoveCurrentToPosition(int)

Moves the current to position.

Declaration

cs-api-definition
public bool MoveCurrentToPosition(int newPosition)

Parameters

newPosition

int

The position.

Returns

bool

Implements ICollectionView<TDataItem>.MoveCurrentToPosition(int)

MoveCurrentToPrevious()

Moves the current to previous.

Declaration

cs-api-definition
public bool MoveCurrentToPrevious()

Returns

bool

Implements ICollectionView<TDataItem>.MoveCurrentToPrevious()

MoveToFirstPage()

Sets the first page as the current page.

Declaration

cs-api-definition
public virtual bool MoveToFirstPage()

Returns

bool

true if the operation was successful; otherwise, false.

Implements IPagedCollectionView.MoveToFirstPage()

MoveToLastPage()

Sets the last page as the current page.

Declaration

cs-api-definition
public virtual bool MoveToLastPage()

Returns

bool

true if the operation was successful; otherwise, false.

Implements IPagedCollectionView.MoveToLastPage()

MoveToNextPage()

Moves to the page after the current page.

Declaration

cs-api-definition
public virtual bool MoveToNextPage()

Returns

bool

true if the operation was successful; otherwise, false.

Implements IPagedCollectionView.MoveToNextPage()

MoveToPage(int)

Requests a page move to the page at the specified zero-based index.

Declaration

cs-api-definition
public virtual bool MoveToPage(int pageIndex)

Parameters

pageIndex

int

The zero-based index of the page to move to.

Returns

bool

true if the operation was successful; otherwise, false.

Implements IPagedCollectionView.MoveToPage(int)

MoveToPreviousPage()

Moves to the page before the current page.

Declaration

cs-api-definition
public virtual bool MoveToPreviousPage()

Returns

bool

true if the operation was successful; otherwise, false.

Implements IPagedCollectionView.MoveToPreviousPage()

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Declaration

cs-api-definition
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)

Parameters

args

NotifyCollectionChangedEventArgs

OnCurrentChanged(EventArgs)

Declaration

cs-api-definition
protected virtual void OnCurrentChanged(EventArgs args)

Parameters

args

EventArgs

OnCurrentChanging(CancelEventArgs)

Declaration

cs-api-definition
protected virtual void OnCurrentChanging(CancelEventArgs args)

Parameters

args

CancelEventArgs

OnNotifyPropertyChanged(PropertyChangedEventArgs)

Raises the NotifyPropertyChanged event

Declaration

cs-api-definition
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)

Parameters

e

PropertyChangedEventArgs

OnPageChanged()

Fires the PageChanged event.

Declaration

cs-api-definition
protected virtual void OnPageChanged()

OnPageChanging(int)

Fires the PageChanging event. Returns the value of the Cancel event argument.

Declaration

cs-api-definition
protected virtual bool OnPageChanging(int newIndex)

Parameters

newIndex

int

The new index.

Returns

bool

True if the event was canceled, otherwise false.

PassesFilter(TDataItem)

Passeses the filter.

Declaration

cs-api-definition
public virtual bool PassesFilter(TDataItem item)

Parameters

item

TDataItem

The item.

Returns

bool

ProcessCollectionChanged(NotifyCollectionChangedEventArgs)

Declaration

cs-api-definition
protected virtual void ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)

Parameters

args

NotifyCollectionChangedEventArgs

Refresh()

Refreshes this data view.

Declaration

cs-api-definition
public virtual void Refresh()

Implements ICollectionView<TDataItem>.Refresh()

RefreshOverride()

Declaration

cs-api-definition
protected virtual void RefreshOverride()

SetCurrentPositionCore(int, bool)

The core update routine for the current position.

Declaration

cs-api-definition
protected virtual bool SetCurrentPositionCore(int newPosition, bool forceNotify)

Parameters

newPosition

int

New position of the current item.

forceNotify

bool

True to raise CurrentChanged regardless of whether actual position change is available.

Returns

bool

SetCurrentPositionCore(int, bool, CurrentChangeReason)

Declaration

cs-api-definition
protected bool SetCurrentPositionCore(int newPosition, bool forceNotify, CurrentChangeReason reason)

Parameters

newPosition

int

forceNotify

bool

reason

CurrentChangeReason

Returns

bool

VersionUpdateNeeded(NotifyCollectionChangedEventArgs)

Declaration

cs-api-definition
protected virtual bool VersionUpdateNeeded(NotifyCollectionChangedEventArgs args)

Parameters

args

NotifyCollectionChangedEventArgs

Returns

bool

Events

CollectionChanged

Declaration

cs-api-definition
public event NotifyCollectionChangedEventHandler CollectionChanged

Event Value

NotifyCollectionChangedEventHandler

Implements ICollectionView<TDataItem>.CollectionChangedINotifyCollectionChanged.CollectionChanged

CurrentChanged

Declaration

cs-api-definition
public event EventHandler CurrentChanged

Event Value

EventHandler

Implements ICollectionView<TDataItem>.CurrentChanged

CurrentChanging

Declaration

cs-api-definition
public event CancelEventHandler CurrentChanging

Event Value

CancelEventHandler

Implements ICollectionView<TDataItem>.CurrentChanging

PageChanged

Occurs when the IPagedCollectionView.PageIndex has changed.

Declaration

cs-api-definition
public event EventHandler<EventArgs> PageChanged

Event Value

EventHandler<EventArgs>

Implements IPagedCollectionView.PageChanged

PageChanging

Occurs before the IPagedCollectionView.PageIndex is changed.

Declaration

cs-api-definition
public event EventHandler<PageChangingEventArgs> PageChanging

Event Value

EventHandler<PageChangingEventArgs>

Implements IPagedCollectionView.PageChanging

PropertyChanged

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged

In this article
DefinitionConstructorsRadCollectionView(IEnumerable<TDataItem>)PropertiesBypassFilterBypassSortCanChangePageCanFilterCanGroupCanPageCanSortCaseSensitiveChangeCurrentOnAddComparerCountCurrentItemCurrentPositionDefaultFilterDefaultGroupPredicateFilterFilterExpressionGroupComparerGroupDescriptorCollectionFactoryGroupDescriptorsGroupFactoryGroupPredicateGroupsHasDataOperationHasFilterHasGroupHasSortIsDynamicIsEmptyIsInUpdateIsIncrementalFilteringIsPageChangingItemCountItemsPageIndexPageSizePagingBeforeGroupingSortDescriptorCollectionFactorySortDescriptorsSourceCollectionTotalPagesthis[int]MethodsBeginUpdate()ClearThreadedFilterNodes()Contains(TDataItem)ContainsGroup(Group<TDataItem>)CopyTo(TDataItem[], int)DeferRefresh()EndUpdate()EndUpdate(bool)EnsureDescriptors()EnsurePageIndex()Evaluate(string, IEnumerable<TDataItem>)Evaluate(string, TDataItem)Evaluate(string, int, int)FilterEvaluate(FilterDescriptor, TDataItem)Find(int, object)FindGroup(Group<TDataItem>)GetEnumerator()GetFieldValue(TDataItem, string)GetItemPage(TDataItem)IndexOf(TDataItem)InitializeSource(IEnumerable<TDataItem>)LoadData(IEnumerable<TDataItem>)MoveCurrentTo(TDataItem)MoveCurrentToFirst()MoveCurrentToLast()MoveCurrentToNext()MoveCurrentToPosition(int)MoveCurrentToPrevious()MoveToFirstPage()MoveToLastPage()MoveToNextPage()MoveToPage(int)MoveToPreviousPage()OnCollectionChanged(NotifyCollectionChangedEventArgs)OnCurrentChanged(EventArgs)OnCurrentChanging(CancelEventArgs)OnNotifyPropertyChanged(PropertyChangedEventArgs)OnPageChanged()OnPageChanging(int)PassesFilter(TDataItem)ProcessCollectionChanged(NotifyCollectionChangedEventArgs)Refresh()RefreshOverride()SetCurrentPositionCore(int, bool)SetCurrentPositionCore(int, bool, CurrentChangeReason)VersionUpdateNeeded(NotifyCollectionChangedEventArgs)EventsCollectionChangedCurrentChangedCurrentChangingPageChangedPageChangingPropertyChanged
Not finding the help you need?
Contact Support