Provides a read-only indexed projection of a source sequence using a RadCollectionView<TDataItem>'s filtering, sorting, and grouping settings.
Call Load(IEnumerable<TDataItem>) to replace the indexed source sequence. The current-item members required by ICollectionView<T> are not supported: navigation returns false, the current position is -1, and explicit refresh is a no-op.
The collection-change and current-item events are raised only when the corresponding protected notification methods are invoked.
Definition
Namespace:Telerik.WinControls.Data
Assembly:Telerik.WinControls.dll
Type Parameters:
TDataItem
The data-item type shown by the snapshot.
Syntax:
public class SnapshotCollectionView<TDataItem> : ISnapshotCollectionView<TDataItem>, ICollectionView<TDataItem>, IReadOnlyCollection<TDataItem>, IEnumerable where TDataItem : IDataItem
Inheritance: objectSnapshotCollectionView<TDataItem>
Implements:
Constructors
Creates an indexed snapshot that uses the source view's sort and group descriptors.
public SnapshotCollectionView(IEnumerable<TDataItem> sourceCollection, RadCollectionView<TDataItem> sourceView)
The sequence to expose through the snapshot.
sourceViewRadCollectionView<TDataItem>The view that supplies filtering, sorting, and grouping behavior.
Properties
GroupBuilder
GroupBuilder<TDataItem>
Gets the lazily created group builder used to produce this snapshot's group hierarchy.
protected virtual GroupBuilder<TDataItem> GroupBuilder { get; }
GroupComparer
IComparer<Group<TDataItem>>
Gets or sets the comparer used to order groups in this snapshot.
public virtual IComparer<Group<TDataItem>> GroupComparer { get; set; }
Implements:
GroupPredicate
GroupPredicate<TDataItem>
Gets or sets the group predicate.
public virtual GroupPredicate<TDataItem> GroupPredicate { get; set; }
The group predicate.
Groups
GroupCollection<TDataItem>
Gets the groups.
public GroupCollection<TDataItem> Groups { get; }
The groups.
Implements:
Gets the lazily created index that applies the source view's item operations.
protected virtual Index<TDataItem> Indexer { get; }
SourceCollection
IEnumerable<TDataItem>
Gets the source collection.
public IEnumerable<TDataItem> SourceCollection { get; }
The source collection.
Implements:
SourceView
RadCollectionView<TDataItem>
Gets the source view that supplies this snapshot's descriptors and filter.
protected virtual RadCollectionView<TDataItem> SourceView { get; }
Methods
Copies the indexed items into an array starting at the specified destination index.
public void CopyTo(TDataItem[] array, int index)
The destination array.
indexintThe zero-based destination index.
Implements:
Evaluates an expression against a contiguous range of items in this snapshot.
public object Evaluate(string expression, int startIndex, int count)
The expression understood by the source view's expression evaluator.
startIndexintThe zero-based index of the first item to include.
countintThe number of consecutive items to include.
Returns:The expression result; aggregate expressions use the range, while non-aggregate expressions use its first item. A zero-count range returns null when startIndex is a valid item index.
startIndex is outside the snapshot's item indexes.
Evaluates an expression against the specified item as it appears in this snapshot.
Enumerates the items in their indexed view order.
public IEnumerator<TDataItem> GetEnumerator()
IEnumerator<TDataItem>
Finds the position of an item equal to the specified value in the indexed view.
public int IndexOf(TDataItem value)
The item to locate.
Returns:The zero-based position, or -1 if no equal item is present.
Implements:
Replaces the sequence exposed by the snapshot and reloads its index.
public void Load(IEnumerable<TDataItem> source)
The new sequence to index.
Raises CollectionChanged for a derived implementation.
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
The collection change to publish.
Raises CurrentChanged for a derived implementation.
protected virtual void OnCurrentChanged(EventArgs args)
The current-item change data.
Raises CurrentChanging for a derived implementation.
protected virtual void OnCurrentChanging(CancelEventArgs args)
The current-item change data.
Sets the view in dirty state.
public void SetDirty()
Events
Occurs when this snapshot publishes a collection-change notification.
public event NotifyCollectionChangedEventHandler CollectionChanged
Implements:
Occurs when a derived implementation reports a current-item change.
public event EventHandler CurrentChanged
Implements:
Occurs when a derived implementation reports a pending current-item change.
public event CancelEventHandler CurrentChanging
Implements: