Provides a concrete collection view with indexed filtering, sorting, grouping, and optional paging for IDataItem collections.
Definition
Namespace:Telerik.WinControls.Data
Assembly:Telerik.WinControls.dll
Type Parameters:
TDataItem
The data-item type exposed by the view.
Syntax:
public class RadDataView<TDataItem> : RadCollectionView<TDataItem>, ICollectionView<TDataItem>, IPagedCollectionView, IReadOnlyCollection<TDataItem>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged where TDataItem : IDataItem
Inheritance: objectRadCollectionView<TDataItem>RadDataView<TDataItem>
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes the view over a data-item sequence and creates its index and group builder.
public RadDataView(IEnumerable<TDataItem> collection)
The sequence to expose through the view.
Properties
Gets or sets a value indicating whether this data view can filter.
public override bool CanFilter { get; set; }
true if this instance can filter; otherwise, false.
Overrides:
Gets or sets a value indicating whether this data view can group.
public override bool CanGroup { get; set; }
true if this instance can group; otherwise, false.
Overrides:
Gets or sets a value indicating whether this data view can be paginated.
public override bool CanPage { get; set; }
true if this data view can be paginated; otherwise, false.
Overrides:
Gets or sets a value indicating whether this data view can sort.
public override bool CanSort { get; set; }
true if this instance can sort; otherwise, false.
Overrides:
Comparer
IComparer<TDataItem>
Gets or sets the sort comparer.
public override IComparer<TDataItem> Comparer { get; set; }
The comparer.
Overrides:
DefaultGroupPredicate
GroupPredicate<TDataItem>
Gets the default group predicate.
public override GroupPredicate<TDataItem> DefaultGroupPredicate { get; }
The default group predicate.
Overrides:
GroupBuilder
GroupBuilder<TDataItem>
Gets the builder that materializes groups from this view's index and descriptors.
public GroupBuilder<TDataItem> GroupBuilder { get; }
GroupComparer
IComparer<Group<TDataItem>>
Gets or sets the group comparer.
public override IComparer<Group<TDataItem>> GroupComparer { get; set; }
The group comparer.
Overrides:
GroupPredicate
GroupPredicate<TDataItem>
Gets or sets the group predicate.
public override GroupPredicate<TDataItem> GroupPredicate { get; set; }
The group predicate.
Overrides:
Groups
GroupCollection<TDataItem>
Gets the groups.
public override GroupCollection<TDataItem> Groups { get; }
The groups.
Overrides:
Gets the index that supplies the view's filtered and sorted items.
public Index<TDataItem> Indexer { get; }
Gets the number of items in the index, independent of the currently exposed page.
public override int ItemCount { get; }
Overrides:
Items
IList<TDataItem>
Gets the current indexed items, applying item-level paging when compatible with the grouping order.
protected override IList<TDataItem> Items { get; }
Overrides:
When paging follows grouping, the full item index remains available so the group builder can page groups instead.
Gets the number of pages of items or top-level groups, according to the paging order.
public override int TotalPages { get; }
Overrides:
When grouping is active and paging follows grouping, pages are counted from the top-level groups; otherwise the base view's item-page count is used.
Gets or sets whether the view uses a hybrid list/tree index instead of an AVL index.
public bool UseHybridIndex { get; set; }
The default is true. Changing the setting recreates the index and group builder.
Methods
Creates a group builder over the current item index.
protected virtual GroupBuilder<TDataItem> CreateGroupBuilder()
GroupBuilder<TDataItem>
A builder that generates the hierarchy exposed by Groups.
Creates the index implementation selected by UseHybridIndex.
protected virtual Index<TDataItem> CreateIndex()
Index<TDataItem>
A HybridIndex<T> or AvlIndex<T> for this view.
Resolves the field indexes used by the current sort and group descriptors.
public override void EnsureDescriptors()
Overrides:
Finds a data item by its view index or associated bound object when no data operation is active.
public override TDataItem Find(int itemIndex, object dataBoundItem)
The candidate index in the view.
dataBoundItemobjectThe underlying object to match against DataBoundItem.
Returns:TDataItem
The matching item, or the default value when no match is available.
Overrides:
When filtering, sorting, or grouping is active, this override currently returns the default value instead of searching by the bound object.
Gets the indexer's page for an item, or zero when paging is disabled.
public override int GetItemPage(TDataItem item)
The item whose page is requested.
Returns:The page index when paging is enabled; otherwise, zero.
Overrides:
Finds an item in the view's currently exposed item sequence.
public override int IndexOf(TDataItem item)
The item to locate.
Returns:The zero-based index in the current view or page, or -1 if the item is absent.
Overrides:
Sets the last page as the current page.
public override bool MoveToLastPage()
true if the operation was successful; otherwise, false.
Overrides:
Refreshes the index and page position when filtering, sorting, grouping, or paging settings change.
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
The changed view property.
Overrides:
Applies source changes to the indexed view and publishes only changes that affect its projection.
protected override void ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
The source collection change.
Overrides:
Reset and batch changes rebuild the view; item-level changes are processed against the active filter, sort, and group descriptors.
Rebuilds the indexed view, or resolves descriptor indexes when a deferred update is in progress.
protected override void RefreshOverride()
Overrides: