Class QueryableCollectionView
Represents a view for grouping, sorting, filtering and paging data collection using LINQ based query operators.
Inheritance
Namespace: Telerik.Windows.Data
Assembly: Telerik.Windows.Data.dll
Syntax
public class QueryableCollectionView : Object, IEditableCollectionView, IEditableCollectionViewAddNewItem, ICollectionView, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, IPagedCollectionView, IWeakEventListener<NotifyCollectionChangedEventArgs>, IWeakEventListener<CurrentChangingEventArgs>, IQueryableCollectionView, IItemProperties, IDisposable
Constructors
QueryableCollectionView(IEnumerable)
Initializes a new instance of the Queryable
Declaration
public QueryableCollectionView(IEnumerable source)
Parameters
System. The source collection. |
QueryableCollectionView(IEnumerable, Type)
Initializes a new instance of the Queryable
Declaration
public QueryableCollectionView(IEnumerable sourceCollection, Type itemType)
Parameters
System. The source collection. |
System. Type which will be used for all operations. |
Exceptions
System.
|
Properties
CanAddNew
Gets a value that indicates whether a new item can be added to the collection.
Declaration
public virtual bool CanAddNew { get; }
Property Value
System. true if Source |
CanAddNewItem
Gets a value that indicates whether a specified object can be added to the collection.
Declaration
public virtual bool CanAddNewItem { get; }
Property Value
System.
|
CanCancelEdit
Gets a value that indicates whether the editing of an item can be canceled.
Declaration
public virtual bool CanCancelEdit { get; }
Property Value
System. true if Current |
CanChangePage
Gets a value that indicates whether the Page
Declaration
public virtual bool CanChangePage { get; }
Property Value
System. true if the Page |
Implements
CanFilter
Gets a value that indicates whether this view supports filtering via the
Filter
Declaration
public virtual bool CanFilter { get; }
Property Value
System. For a default instance of Queryable |
CanGroup
Gets a value that indicates whether this view supports grouping via the
Group
Declaration
public virtual bool CanGroup { get; }
Property Value
System. For a default instance of Queryable |
CanRemove
Gets a value that indicates whether an item can be removed from the collection.
Declaration
public virtual bool CanRemove { get; }
Property Value
System. true if an item can be removed from the collection; otherwise, false. |
CanSort
Gets a value that indicates whether this view supports sorting via the
Sort
Declaration
public virtual bool CanSort { get; }
Property Value
System. For a default instance of Queryable |
Count
Gets the number of records in the view after grouping, filtering, sorting, and paging.
Declaration
public int Count { get; }
Property Value
System. The number of records in the view after grouping, filtering, sorting, and paging. |
Culture
Gets or sets the cultural info for any operations of the view that may differ by culture, such as sorting.
Declaration
public virtual CultureInfo Culture { get; set; }
Property Value
System. The culture to use during sorting. |
CurrentAddItem
Gets the item that is being added during the current add transaction.
Declaration
public virtual object CurrentAddItem { get; }
Property Value
System. The item that is being added if Is |
CurrentEditItem
Gets the item in the collection that is being edited.
Declaration
public virtual object CurrentEditItem { get; }
Property Value
System. The item in the collection that is being edited
if Is |
CurrentItem
Declaration
public virtual object CurrentItem { get; }
Property Value
System.
|
CurrentPosition
Declaration
public virtual int CurrentPosition { get; }
Property Value
System.
|
Filter
Gets or sets a callback used to determine if an item is suitable for inclusion in the view.
Declaration
public virtual Predicate<object> Filter { get; set; }
Property Value
System. A method used to determine if an item is suitable for inclusion in the view. |
Exceptions
System. Setting Filter property is not supported. Use Filter |
FilterDescriptors
Gets the filter descriptors used for filtering operations.
Declaration
public virtual CompositeFilterDescriptorCollection FilterDescriptors { get; }
Property Value
Composite The filter descriptors. |
Implements
GroupDescriptions
Gets the underlying System.
Declaration
protected ObservableCollection<GroupDescription> GroupDescriptions { get; }
Property Value
System. The System. |
GroupDescriptors
Gets the group descriptors used for grouping operations.
Declaration
public virtual GroupDescriptorCollection GroupDescriptors { get; }
Property Value
Group The group descriptors. |
Implements
Groups
Gets the top-level groups.
Declaration
public ReadOnlyObservableCollection<object> Groups { get; }
Property Value
System. A read-only collection of the top-level groups or null if there are no groups. |
InternalCount
Protected accessor to private count.
Declaration
protected virtual int InternalCount { get; }
Property Value
System.
|
InternalList
Gets the list created from resulting query after applying filtering, sorting, grouping and paging.
Declaration
protected virtual IList InternalList { get; }
Property Value
System. The internal list for the current view. |
IsAddingNew
Gets a value that indicates whether an add transaction is in progress.
Declaration
public virtual bool IsAddingNew { get; }
Property Value
System. true if an add transaction is in progress; otherwise, false. |
IsCurrentAfterLast
Declaration
public virtual bool IsCurrentAfterLast { get; }
Property Value
System.
|
IsCurrentBeforeFirst
Declaration
public virtual bool IsCurrentBeforeFirst { get; }
Property Value
System.
|
IsEditingItem
Gets a value that indicates whether an edit transaction is in progress.
Declaration
public virtual bool IsEditingItem { get; }
Property Value
System. true if an edit transaction is in progress; otherwise, false. |
IsEmpty
Returns a value that indicates whether the resulting view is empty.
Declaration
public bool IsEmpty { get; }
Property Value
System. true if the resulting view is empty; otherwise, false. |
IsGrouped
Gets a value indicating whether this instance is grouped.
Declaration
public virtual bool IsGrouped { get; }
Property Value
System.
|
IsLoading
Gets a value that indicates whether this view is loading data.
Declaration
public virtual bool IsLoading { get; protected set; }
Property Value
System.
|
IsPageChanging
Gets a value that indicates whether a page index change is in process.
Declaration
public bool IsPageChanging { get; protected set; }
Property Value
System. true if the page index is changing; otherwise, false. |
Implements
IsPaged
Gets a value indicating whether this instance has pages or not.
Declaration
protected virtual bool IsPaged { get; }
Property Value
System.
|
Item[Int32]
This indexer is not supposed to be used directly from your code.
Declaration
public object this[int index] { get; }
Parameters
System.
|
Property Value
System.
|
ItemCount
Gets the minimum number of items known to be in the source collection.
Declaration
public virtual int ItemCount { get; }
Property Value
System. The minimum number of items known to be in the source collection. |
Implements
ItemProperties
Gets a collection of objects that describes the properties of the items in the collection.
Declaration
public ReadOnlyCollection<ItemPropertyInfo> ItemProperties { get; }
Property Value
System. A collection of objects that describes the properties of the items in the collection. |
ItemPropertiesByPropertyName
Gets a dictionary of objects that describes the properties of the items in the collection by property name.
Declaration
public Dictionary<string, ItemPropertyInfo> ItemPropertiesByPropertyName { get; }
Property Value
System. A dictionary of objects that describes the properties of the items in the collection by property name. |
ItemType
Gets or sets the type used for all internal data engine operations.
Declaration
public Type ItemType { get; set; }
Property Value
System. The type of the item. |
NeedsRefresh
Gets a value that indicates whether this view needs to be refreshed.
Declaration
public bool NeedsRefresh { get; set; }
Property Value
System. true if the view needs to be refreshed; otherwise, false. |
NewItemPlaceholderPosition
Gets or sets the position of the new item placeholder in the collection.
Declaration
public virtual NewItemPlaceholderPosition NewItemPlaceholderPosition { get; set; }
Property Value
System. One of the enumeration values that specifies the position of the new item placeholder in the collection. |
PageIndex
Gets the zero-based index of the current page.
Declaration
public int PageIndex { get; protected set; }
Property Value
System. The zero-based index of the current page. |
Implements
PageSize
Gets or sets the number of items to display on a page.
Declaration
public int PageSize { get; set; }
Property Value
System. The number of items to display on a page. |
Implements
PendingCurrencyRefresh
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.
Declaration
protected QueryableCollectionView.CurrencyRefreshInfo PendingCurrencyRefresh { get; set; }
Property Value
QueryableSourceCollection
Returns the queryable collection, constructed from Source
Declaration
public virtual IQueryable QueryableSourceCollection { get; }
Property Value
System. An System. |
ShouldInitializeGroupProxy
Gets a value indicating whether should initialize group proxy.
Declaration
protected virtual bool ShouldInitializeGroupProxy { get; }
Property Value
System.
|
ShouldRefreshOrDeferOnPageSizeChange
Gets a value indicating whether this instance should RefreshOrDefer when PageSize changes.
Declaration
protected virtual bool ShouldRefreshOrDeferOnPageSizeChange { get; }
Property Value
System.
|
ShouldRespectIEditableObject
Gets or set a value that indicates whether IEditableObject methods are automatically invoked by QueryableCollectionView.
Declaration
public bool ShouldRespectIEditableObject { get; set; }
Property Value
System.
|
SortDescriptions
Gets the underlying System.
Declaration
protected SortDescriptionCollection SortDescriptions { get; }
Property Value
System. The System. |
SortDescriptors
Gets the sort descriptors used for sorting operations.
Declaration
public virtual SortDescriptorCollection SortDescriptors { get; }
Property Value
Sort The sort descriptors. |
Implements
SourceCollection
Returns the underlying collection.
Declaration
public IEnumerable SourceCollection { get; }
Property Value
System. An System. |
TotalItemCount
Gets the total number of items in the source collection, or -1 if the total number is unknown.
Declaration
public virtual int TotalItemCount { get; protected set; }
Property Value
System. The total number of items in the source collection, or -1 if the total number is unknown. |
Implements
Methods
AddNew()
Adds a new item to the collection.
Declaration
public virtual object AddNew()
Returns
System. The new item that is added to the collection. |
Exceptions
System. Can |
AddNew(Object)
Adds the new item to the collection.
Declaration
public void AddNew(object newItem)
Parameters
System. The new item that will be added to the collection. |
Exceptions
System. Can |
AddNewItem(Object)
Adds the specified object to the collection.
Declaration
public virtual object AddNewItem(object newItem)
Parameters
System. The object to add to the collection. |
Returns
System.
|
ApplySelectDescriptors(IQueryable)
Applies Select
Declaration
protected virtual IQueryable ApplySelectDescriptors(IQueryable queryable)
Parameters
System. The queryable. |
Returns
System.
|
CancelEdit()
Ends the edit transaction and discards any pending changes to the item.
Declaration
public virtual void CancelEdit()
Exceptions
System. CancelEdit is not supported for the current edit item.
Only items implementing System. |
CancelNew()
Ends the add transaction and discards the pending new item.
Declaration
public virtual void CancelNew()
CommitEdit()
Ends the edit transaction and saves the pending changes.
Declaration
public virtual void CommitEdit()
CommitNew()
Ends the add transaction and saves the pending new item.
Declaration
public virtual void CommitNew()
CompletePageMove(Int32)
Completes the page move.
Declaration
protected virtual void CompletePageMove(int newPageIndex)
Parameters
System. The index of the new page. |
ConstructNewItem()
Constructs a new item.
Declaration
protected virtual object ConstructNewItem()
Returns
System.
|
Contains(Object)
Returns a value that indicates whether a given item belongs to this collection view.
Declaration
public bool Contains(object item)
Parameters
System. The object to check. |
Returns
System. True if the item belongs to this collection view; otherwise, false. |
CreateInternalList()
Called when internal list needs to be created.
Declaration
protected virtual void CreateInternalList()
CreateView()
Returns System.
Declaration
protected virtual IQueryable CreateView()
Returns
System.
|
DeferRefresh()
Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.
Declaration
public IDisposable DeferRefresh()
Returns
System. An System. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Unsubscribes form collection changed events.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
System.
|
EditItem(Object)
Begins an edit transaction of the specified item.
Declaration
public virtual void EditItem(object item)
Parameters
System. The item to edit. |
GetEffectiveItemCount()
Gets the count of items depending on the page and/or grouped state.
Declaration
protected virtual int GetEffectiveItemCount()
Returns
System. The count of items. |
GetEnumerator()
Declaration
public virtual IEnumerator GetEnumerator()
Returns
System.
|
GetInternalList()
Called when internal list is required.
Declaration
protected IList GetInternalList()
Returns
System.
|
GetItemAt(Int32)
Retrieves the item at the specified zero-based index in the view.
Declaration
public virtual object GetItemAt(int index)
Parameters
System. The zero-based index of the item to retrieve. |
Returns
System. The item at the specified zero-based index in the view. |
Exceptions
System.
|
GetPagingDeterminativeItemCount()
Gets the paging determinative item count.
Declaration
protected virtual int GetPagingDeterminativeItemCount()
Returns
System. The paging determinative item count. |
IndexOf(Object)
Returns the zero-based index at which the specified item is located.
Declaration
public virtual int IndexOf(object item)
Parameters
System. The item to locate. |
Returns
System. The index at which the specified item is located, or –1 if the item is unknown. |
InitializeCurrencyOnRefresh(QueryableCollectionView.CurrencyRefreshInfo)
Initializes the currency on refresh.
Declaration
protected void InitializeCurrencyOnRefresh(QueryableCollectionView.CurrencyRefreshInfo currencyRefreshInfo)
Parameters
Queryable The currency refresh info. |
InitializeCurrentItem()
Called when the current item should be initialized.
Declaration
protected void InitializeCurrentItem()
InitializeInternalList(IQueryable)
Called when internal list should be initialized.
Declaration
protected virtual void InitializeInternalList(IQueryable view)
Parameters
System.
|
InvalidatePagingAndRefresh()
Invalidates the paging and refreshes the view.
Declaration
protected virtual void InvalidatePagingAndRefresh()
InvalidatePagingDeterminativeItemCount()
Invalidates the paging determinative item count.
Declaration
protected virtual void InvalidatePagingDeterminativeItemCount()
MoveCurrentTo(Object)
Declaration
public bool MoveCurrentTo(object item)
Parameters
System.
|
Returns
System.
|
MoveCurrentToFirst()
Declaration
public bool MoveCurrentToFirst()
Returns
System.
|
MoveCurrentToLast()
Declaration
public bool MoveCurrentToLast()
Returns
System.
|
MoveCurrentToNext()
Declaration
public bool MoveCurrentToNext()
Returns
System.
|
MoveCurrentToPosition(Int32)
Sets the item at the specified index to be the Current
Declaration
public bool MoveCurrentToPosition(int position)
Parameters
System. The index to set the Current |
Returns
System. True if the resulting Current |
Exceptions
System.
|
MoveCurrentToPrevious()
Declaration
public bool MoveCurrentToPrevious()
Returns
System.
|
MoveToFirstPage()
Sets the first page as the current page.
Declaration
public bool MoveToFirstPage()
Returns
System. true if the operation was successful; otherwise, false. |
Implements
MoveToLastPage()
Sets the last page as the current page.
Declaration
public bool MoveToLastPage()
Returns
System. true if the operation was successful; otherwise, false. |
Implements
MoveToNextPage()
Moves to the page after the current page.
Declaration
public bool MoveToNextPage()
Returns
System. true if the operation was successful; otherwise, false. |
Implements
MoveToPage(Int32)
Requests a page move to the page at the specified index.
Declaration
public bool MoveToPage(int pageIndex)
Parameters
System. The index of the page to move to. |
Returns
System. true if the move was successfully initiated; otherwise, false. |
Implements
MoveToPageCore(Int32)
Requests a page move to the page at the specified index.
Declaration
protected virtual bool MoveToPageCore(int index)
Parameters
System. The index of the page to move to. |
Returns
System. true if the move was successfully initiated; otherwise, false. |
MoveToPreviousPage()
Moves to the page before the current page.
Declaration
public bool MoveToPreviousPage()
Returns
System. true if the operation was successful; otherwise, false. |
Implements
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Raises the Collection
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
System. The System. |
OnCurrentChanged(EventArgs)
Raises the Current
Declaration
protected virtual void OnCurrentChanged(EventArgs args)
Parameters
System. The System. |
OnCurrentChanging()
Raise a non-cancelable CurrentChanging event This is called when CurrentItem is affected by a CollectionChange (Remove or Refresh).
Declaration
protected void OnCurrentChanging()
OnCurrentChanging(CurrentChangingEventArgs)
Raises the Current
Declaration
protected virtual void OnCurrentChanging(CurrentChangingEventArgs args)
Parameters
System. The System. |
OnFilterDescriptorsChanged()
Called when anything in the filter descriptors changes.
Declaration
protected virtual void OnFilterDescriptorsChanged()
OnFilterDescriptorsCollectionChanged(Object, NotifyCollectionChangedEventArgs)
Invoked when the Filter
Declaration
protected virtual void OnFilterDescriptorsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters
System. Current instance of the QueryableCollectionView collection. |
System. Information about the change. |
OnFilterDescriptorsItemChanged(Object, ItemChangedEventArgs<IFilterDescriptor>)
Invoked when the Filter
Declaration
protected virtual void OnFilterDescriptorsItemChanged(object sender, ItemChangedEventArgs<IFilterDescriptor> e)
Parameters
System. Current instance of the QueryableCollectionView collection. |
Item Information about the change. |
OnFilterDescriptorsLogicalOperatorChanged()
Invoked when the Filter
Declaration
protected virtual void OnFilterDescriptorsLogicalOperatorChanged()
OnGroupDescriptorsCollectionChanged(Object, NotifyCollectionChangedEventArgs)
Invoked when the Telerik.
Declaration
protected virtual void OnGroupDescriptorsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters
System. Current instance of the QueryableCollectionView collection. |
System. Information about the change. |
OnGroupDescriptorsItemChanged(Object, ItemChangedEventArgs<IGroupDescriptor>)
Invoked when the Group
Declaration
protected virtual void OnGroupDescriptorsItemChanged(object sender, ItemChangedEventArgs<IGroupDescriptor> e)
Parameters
System. Current instance of the QueryableCollectionView collection. |
Item Information about the change. |
OnInternalListCreated()
Called when internal list is created.
Declaration
protected void OnInternalListCreated()
OnPropertyChanged(PropertyChangedEventArgs)
Raises the Property
Declaration
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters
System. The System. |
OnPropertyChanged(String)
Raises the Property
Declaration
protected void OnPropertyChanged(string propertyName)
Parameters
System. Name of the property. |
OnRefresh()
Invoked when the instance should be refreshed.
Declaration
protected virtual void OnRefresh()
OnSortDescriptorsCollectionChanged(Object, NotifyCollectionChangedEventArgs)
Invoked when the Sort
Declaration
protected virtual void OnSortDescriptorsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters
System. Current instance of the QueryableCollectionView collection. |
System. Information about the change. |
OnSortDescriptorsItemChanged(Object, ItemChangedEventArgs<ISortDescriptor>)
Invoked when the Sort
Declaration
protected virtual void OnSortDescriptorsItemChanged(object sender, ItemChangedEventArgs<ISortDescriptor> e)
Parameters
System. Current instance of the QueryableCollectionView collection. |
Item Information about the change. |
PopulateInternalList(IQueryable)
Called when internal list should be populated.
Declaration
protected virtual void PopulateInternalList(IQueryable view)
Parameters
System.
|
RaisePageChanged()
Refresh()
Declaration
public void Refresh()
RefreshGroupsOnItemAction(Object, ItemAction)
Refreshes the groups according to the item and the respective action.
Declaration
protected void RefreshGroupsOnItemAction(object item, ItemAction action)
Parameters
System. The item. |
Item The action. |
RefreshOnItemAction(Object, ItemAction)
Refreshes the view according to the item and the respective action.
Declaration
protected virtual void RefreshOnItemAction(object item, ItemAction action)
Parameters
System. The item. |
Item The action. |
RefreshOnItemActionWithoutPaging(Object, ItemAction)
Refreshes the view according to the item and the respective action when there is no paging involved.
Declaration
protected void RefreshOnItemActionWithoutPaging(object item, ItemAction action)
Parameters
System. The item. |
Item The action. |
RefreshOverride()
Re-create the view over the associated IList.
Declaration
protected virtual void RefreshOverride()
RefreshOverrideCore()
Re-create the view over the associated IList.
Declaration
protected void RefreshOverrideCore()
Remove(Object)
Removes the specified item from the collection.
Declaration
public virtual void Remove(object item)
Parameters
System. The item to remove. |
RemoveAt(Int32)
Removes the item at the specified position from the collection.
Declaration
public virtual void RemoveAt(int index)
Parameters
System. The position of the item to remove. |
SetCurrent(Object, Int32)
Sets the CurrentItem and CurrentPosition.
Declaration
protected void SetCurrent(object newItem, int newPosition)
Parameters
System. The new current item. |
System. The new current position. |
SetCurrentPosition(Int32)
Sets the CurrentnewPosition
.
Declaration
protected void SetCurrentPosition(int newPosition)
Parameters
System. The new position. |
SetInternalList(IList)
Called when internal list should be set.
Declaration
protected void SetInternalList(IList list)
Parameters
System.
|
Sort(IQueryable)
Sorts the specified queryable.
Declaration
protected IQueryable Sort(IQueryable queryable)
Parameters
System.
|
Returns
System.
|
UpdateItemCount()
Called when the count of the items should be updated.
Declaration
protected void UpdateItemCount()
UpdateTotalItemCount()
Called when the count of all items should be updated.
Declaration
protected virtual void UpdateTotalItemCount()
Events
CollectionChanged
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
System.
|
CurrentChanged
Declaration
public event EventHandler CurrentChanged
Event Type
System.
|
CurrentChanging
Declaration
public event CurrentChangingEventHandler CurrentChanging
Event Type
System.
|
GroupCollectionChanged
This is for internal use only and is not intended to be used directly from your code.
Declaration
public event EventHandler<NotifyGroupCollectionChangedEventArgs> GroupCollectionChanged
Event Type
System.
|
PageChanged
Occurs when the Page
Declaration
public event EventHandler<EventArgs> PageChanged
Event Type
System.
|
Implements
PageChanging
Occurs when the Page
Declaration
public event EventHandler<PageChangingEventArgs> PageChanging
Event Type
System.
|
Implements
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.
|