Represents a view for grouping, sorting, filtering and paging data collection using LINQ based query operators.
Definition
Namespace:Telerik.Windows.Data
Assembly:Telerik.Windows.Data.dll
Syntax:
public class QueryableCollectionView : ICollectionView, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, IPagedCollectionView, IQueryableCollectionView, IItemProperties, IDisposable, IEditableCollectionView, IEditableCollectionViewAddNewItem
Inheritance: objectQueryableCollectionView
Derived Classes:
Implements:
Constructors
Initializes a new instance of the QueryableCollectionView class.
public QueryableCollectionView(IEnumerable sourceCollection, Type itemType)
The source collection.
itemTypeTypeType which will be used for all operations.
Exceptions:sourceCollection is null.
Initializes a new instance of the QueryableCollectionView class.
public QueryableCollectionView(IEnumerable source)
The source collection.
Properties
Gets a value that indicates whether a new item can be added to the collection.
public virtual bool CanAddNew { get; }
true if SourceCollection is not IsFixedSize or Add method is available and collection element has a default constructor; otherwise, false.
Gets a value that indicates whether a specified object can be added to the collection.
public virtual bool CanAddNewItem { get; }
true if a specified object can be added to the collection; otherwise false.
Gets a value that indicates whether the editing of an item can be canceled.
public virtual bool CanCancelEdit { get; }
true if CurrentEditItem implements IEditableObject; otherwise, false.
Gets a value that indicates whether this view supports filtering via the FilterDescriptors property.
public virtual bool CanFilter { get; }
For a default instance of QueryableCollectionView, this property always returns true.
Gets a value that indicates whether this view supports grouping via the GroupDescriptors property.
public virtual bool CanGroup { get; }
For a default instance of QueryableCollectionView, this property always returns true.
Gets a value that indicates whether an item can be removed from the collection.
public virtual bool CanRemove { get; }
true if an item can be removed from the collection; otherwise, false.
Gets a value that indicates whether this view supports sorting via the SortDescriptors property.
public virtual bool CanSort { get; }
For a default instance of QueryableCollectionView, this property always returns true.
Gets the number of records in the view after grouping, filtering, sorting, and paging.
public int Count { get; }
The number of records in the view after grouping, filtering, sorting, and paging.
Gets or sets the cultural info for any operations of the view that may differ by culture, such as sorting.
public virtual CultureInfo Culture { get; set; }
The culture to use during sorting.
Gets the item that is being added during the current add transaction.
public virtual object CurrentAddItem { get; }
The item that is being added if IsAddingNew is true; otherwise, null.
Gets the item in the collection that is being edited.
public virtual object CurrentEditItem { get; }
The item in the collection that is being edited if IsEditingItem is true; otherwise, null.
public virtual object CurrentItem { get; }
public virtual int CurrentPosition { get; }
Gets or sets a callback used to determine if an item is suitable for inclusion in the view.
public virtual Predicate<object> Filter { get; set; }
A method used to determine if an item is suitable for inclusion in the view.
Exceptions:Setting Filter property is not supported. Use FilterDescriptors property instead.
Gets the filter descriptors used for filtering operations.
public virtual CompositeFilterDescriptorCollection FilterDescriptors { get; }
The filter descriptors.
Implements:
GroupDescriptions
ObservableCollection<GroupDescription>
Gets the underlying collection.
protected ObservableCollection<GroupDescription> GroupDescriptions { get; }
The for this view.
Gets the group descriptors used for grouping operations.
public virtual GroupDescriptorCollection GroupDescriptors { get; }
The group descriptors.
Implements:
Gets the top-level groups.
public ReadOnlyObservableCollection<object> Groups { get; }
A read-only collection of the top-level groups or null if there are no groups.
Protected accessor to private count.
protected virtual int InternalCount { get; }
Gets the list created from resulting query after applying filtering, sorting, grouping and paging.
protected virtual IList InternalList { get; }
The internal list for the current view.
Gets a value that indicates whether an add transaction is in progress.
public virtual bool IsAddingNew { get; }
true if an add transaction is in progress; otherwise, false.
public virtual bool IsCurrentAfterLast { get; }
public virtual bool IsCurrentBeforeFirst { get; }
Gets a value that indicates whether an edit transaction is in progress.
public virtual bool IsEditingItem { get; }
true if an edit transaction is in progress; otherwise, false.
Returns a value that indicates whether the resulting view is empty.
public bool IsEmpty { get; }
true if the resulting view is empty; otherwise, false.
Gets a value indicating whether this instance is grouped.
public virtual bool IsGrouped { get; }
true if this instance is grouped; otherwise, false.
Gets a value that indicates whether this view is loading data.
public virtual bool IsLoading { get; protected set; }
Gets a value that indicates whether a page index change is in process.
public bool IsPageChanging { get; protected set; }
true if the page index is changing; otherwise, false.
Implements:
Gets a value indicating whether this instance has pages or not.
protected virtual bool IsPaged { get; }
true if this instance has PageSize greater than 0; otherwise, false.
Gets the minimum number of items known to be in the source collection.
public virtual int ItemCount { get; }
The minimum number of items known to be in the source collection.
Implements:
ItemProperties
ReadOnlyCollection<ItemPropertyInfo>
Gets a collection of objects that describes the properties of the items in the collection.
public ReadOnlyCollection<ItemPropertyInfo> ItemProperties { get; }
A collection of objects that describes the properties of the items in the collection.
ItemPropertiesByPropertyName
Dictionary<string, ItemPropertyInfo>
Gets a dictionary of objects that describes the properties of the items in the collection by property name.
public Dictionary<string, ItemPropertyInfo> ItemPropertiesByPropertyName { get; }
A dictionary of objects that describes the properties of the items in the collection by property name.
Gets or sets the type used for all internal data engine operations.
public Type ItemType { get; set; }
The type of the item.
Gets a value that indicates whether this view needs to be refreshed.
public bool NeedsRefresh { get; set; }
true if the view needs to be refreshed; otherwise, false.
NewItemPlaceholderPosition
NewItemPlaceholderPosition
Gets or sets the position of the new item placeholder in the collection.
public virtual NewItemPlaceholderPosition NewItemPlaceholderPosition { get; set; }
One of the enumeration values that specifies the position of the new item placeholder in the collection.
Gets the zero-based index of the current page.
public int PageIndex { get; protected set; }
The zero-based index of the current page.
Implements:
Gets or sets the number of items to display on a page.
public int PageSize { get; set; }
The number of items to display on a page.
Implements:
Used to hold "old" currency info when DataLoadMode is Asynchronous and we need to refresh the currency after the load is complete. This field is not supposed to be used directly from your code.
protected QueryableCollectionView.CurrencyRefreshInfo PendingCurrencyRefresh { get; set; }
Returns the queryable collection, constructed from SourceCollection.
public virtual IQueryable QueryableSourceCollection { get; }
An IQueryable object that is constructed from the underlying collection.
Gets a value indicating whether should initialize group proxy.
protected virtual bool ShouldInitializeGroupProxy { get; }
true if should initialize group proxy; otherwise, false.
Gets a value indicating whether this instance should RefreshOrDefer when PageSize changes.
protected virtual bool ShouldRefreshOrDeferOnPageSizeChange { get; }
true if this instance should RefreshOrDefer when PageSize changes; otherwise, false.
Gets or set a value that indicates whether IEditableObject methods are automatically invoked by QueryableCollectionView.
public bool ShouldRespectIEditableObject { get; set; }
SortDescriptions
SortDescriptionCollection
Gets the underlying collection.
protected SortDescriptionCollection SortDescriptions { get; }
The for this view.
Gets the sort descriptors used for sorting operations.
public virtual SortDescriptorCollection SortDescriptors { get; }
The sort descriptors.
Implements:
Returns the underlying collection.
public IEnumerable SourceCollection { get; }
An IEnumerable object that is the underlying collection.
Gets the total number of items in the source collection, or -1 if the total number is unknown.
public virtual int TotalItemCount { get; protected set; }
The total number of items in the source collection, or -1 if the total number is unknown.
Implements:
Methods
Adds a new item to the collection.
public virtual object AddNew()
The new item that is added to the collection.
Exceptions:CanAddNew is false.
Applies SelectDescriptors over the specified queryable.
protected virtual IQueryable ApplySelectDescriptors(IQueryable queryable)
The queryable.
Returns:Ends the edit transaction and discards any pending changes to the item.
public virtual void CancelEdit()
CancelEdit is not supported for the current edit item. Only items implementing IEditableObject are supported.
Ends the add transaction and discards the pending new item.
public virtual void CancelNew()
Ends the edit transaction and saves the pending changes.
public virtual void CommitEdit()
Ends the add transaction and saves the pending new item.
public virtual void CommitNew()
Completes the page move.
protected virtual void CompletePageMove(int newPageIndex)
The index of the new page.
Constructs a new item.
Called when internal list needs to be created.
protected virtual void CreateInternalList()
Returns IQueryable with applied filtering, sorting, grouping and paging.
Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.
public IDisposable DeferRefresh()
An IDisposable object that you can use to dispose of the calling object.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Implements:
Unsubscribes form collection changed events.
Begins an edit transaction of the specified item.
Gets the count of items depending on the page and/or grouped state.
Called when internal list is required.
Gets the paging determinative item count.
protected virtual int GetPagingDeterminativeItemCount()
The paging determinative item count.
Initializes the currency on refresh.
protected void InitializeCurrencyOnRefresh(QueryableCollectionView.CurrencyRefreshInfo currencyRefreshInfo)
The currency refresh info.
Called when the current item should be initialized.
protected void InitializeCurrentItem()
Called when internal list should be initialized.
Invalidates the paging and refreshes the view.
protected virtual void InvalidatePagingAndRefresh()
Invalidates the paging determinative item count.
protected virtual void InvalidatePagingDeterminativeItemCount()
Sets the item at the specified index to be the CurrentItem in the view.
public bool MoveCurrentToPosition(int position)
The index to set the CurrentItem to.
Returns:True if the resulting CurrentItem is an item within the view; otherwise, false.
Exceptions:position is out of range.
Sets the first page as the current page.
public bool MoveToFirstPage()
true if the operation was successful; otherwise, false.
Implements:
Sets the last page as the current page.
public bool MoveToLastPage()
true if the operation was successful; otherwise, false.
Implements:
Moves to the page after the current page.
public bool MoveToNextPage()
true if the operation was successful; otherwise, false.
Implements:
Moves to the page before the current page.
public bool MoveToPreviousPage()
true if the operation was successful; otherwise, false.
Implements:
Raises the CollectionChanged event.
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
The NotifyCollectionChangedEventArgs instance containing the event data.
Raises the CurrentChanged event.
Raise a non-cancelable CurrentChanging event This is called when CurrentItem is affected by a CollectionChange (Remove or Refresh).
protected void OnCurrentChanging()
Raises the CurrentChanging event.
protected virtual void OnCurrentChanging(CurrentChangingEventArgs args)
The CurrentChangingEventArgs instance containing the event data.
Called when anything in the filter descriptors changes.
protected virtual void OnFilterDescriptorsChanged()
Invoked when the FilterDescriptors collection changes.
protected virtual void OnFilterDescriptorsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Current instance of the QueryableCollectionView collection.
eNotifyCollectionChangedEventArgsInformation about the change.
Invoked when the FilterDescriptors item changes.
protected virtual void OnFilterDescriptorsItemChanged(object sender, ItemChangedEventArgs<IFilterDescriptor> e)
Current instance of the QueryableCollectionView collection.
eItemChangedEventArgs<IFilterDescriptor>Information about the change.
Invoked when the FilterDescriptors logical operator changes.
protected virtual void OnFilterDescriptorsLogicalOperatorChanged()
Invoked when the collection changes.
protected virtual void OnGroupDescriptorsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Current instance of the QueryableCollectionView collection.
eNotifyCollectionChangedEventArgsInformation about the change.
Invoked when the GroupDescriptors item changes.
protected virtual void OnGroupDescriptorsItemChanged(object sender, ItemChangedEventArgs<IGroupDescriptor> e)
Current instance of the QueryableCollectionView collection.
eItemChangedEventArgs<IGroupDescriptor>Information about the change.
Called when internal list is created.
protected void OnInternalListCreated()
Raises the PropertyChanged event.
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
The PropertyChangedEventArgs instance containing the event data.
Raises the PropertyChanged event.
protected void OnPropertyChanged(string propertyName)
Name of the property.
Invoked when the instance should be refreshed.
protected virtual void OnRefresh()
Invoked when the SortDescriptors collection changes.
protected virtual void OnSortDescriptorsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Current instance of the QueryableCollectionView collection.
eNotifyCollectionChangedEventArgsInformation about the change.
Invoked when the SortDescriptors item changes.
protected virtual void OnSortDescriptorsItemChanged(object sender, ItemChangedEventArgs<ISortDescriptor> e)
Current instance of the QueryableCollectionView collection.
eItemChangedEventArgs<ISortDescriptor>Information about the change.
Called when internal list should be populated.
Raises the PageChanged event.
protected void RaisePageChanged()
public void Refresh()
Refreshes the groups according to the item and the respective action.
protected void RefreshGroupsOnItemAction(object item, ItemAction action)
The item.
actionItemActionThe action.
Refreshes the view according to the item and the respective action.
protected virtual void RefreshOnItemAction(object item, ItemAction action)
The item.
actionItemActionThe action.
Refreshes the view according to the item and the respective action when there is no paging involved.
protected void RefreshOnItemActionWithoutPaging(object item, ItemAction action)
The item.
actionItemActionThe action.
Re-create the view over the associated IList.
protected virtual void RefreshOverride()
Re-create the view over the associated IList.
protected void RefreshOverrideCore()
Removes the specified item from the collection.
Removes the item at the specified position from the collection.
Sets the CurrentPosition to the given newPosition .
Called when internal list should be set.
Sorts the specified queryable.
Called when the count of the items should be updated.
protected void UpdateItemCount()
Called when the count of all items should be updated.
protected virtual void UpdateTotalItemCount()
Events
public event NotifyCollectionChangedEventHandler CollectionChanged
Implements:
public event EventHandler CurrentChanged
CurrentChanging
CurrentChangingEventHandler
public event CurrentChangingEventHandler CurrentChanging
This is for internal use only and is not intended to be used directly from your code.
public event EventHandler<NotifyGroupCollectionChangedEventArgs> GroupCollectionChanged
Occurs when the PageIndex has changed.
public event EventHandler<EventArgs> PageChanged
Implements:
Occurs when the PageIndex is changing.
public event EventHandler<PageChangingEventArgs> PageChanging
Implements:
public event PropertyChangedEventHandler PropertyChanged
Implements: