Class DataItemCollection
DataItemCollection.
Inheritance
Namespace: Telerik.Windows.Data
Assembly: Telerik.Windows.Data.dll
Syntax
public class DataItemCollection : Object, IList, ICollection, IQueryableCollectionView, IItemProperties, IEditableCollectionViewAddNewItem, IEditableCollectionView, ICollectionView, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, IPagedCollectionView
Properties
CanAddNew
Gets a value that indicates whether a new item can be added to the collection.
Declaration
public bool CanAddNew { get; }
Property Value
System.Boolean
true if SourceCollection is not System.Collections.IList.IsFixedSize and collection element has a default constructor; otherwise, false. |
CanAddNewItem
Gets a value that indicates whether a specified object can be added to the collection.
Declaration
public bool CanAddNewItem { get; }
Property Value
System.Boolean
|
Implements
CanCancelEdit
Gets a value that indicates whether the editing of an item can be canceled.
Declaration
public bool CanCancelEdit { get; }
Property Value
System.Boolean
true if CurrentEditItem implements System.ComponentModel.IEditableObject; otherwise, false. |
CanChangePage
Gets a value that indicates whether the PageIndex value can change.
Declaration
public bool CanChangePage { get; }
Property Value
System.Boolean
true if the PageIndex value can change; otherwise, false. |
CanFilter
Gets a value that indicates whether this view supports filtering via the System.ComponentModel.ICollectionView.Filter property.
Declaration
public bool CanFilter { get; }
Property Value
System.Boolean
|
CanGroup
Gets a value that indicates whether this view supports grouping via the System.ComponentModel.ICollectionView.GroupDescriptions property.
Declaration
public bool CanGroup { get; }
Property Value
System.Boolean
|
CanRemove
Gets a value that indicates whether an item can be removed from the collection.
Declaration
public bool CanRemove { get; }
Property Value
System.Boolean
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 System.ComponentModel.ICollectionView.SortDescriptions property.
Declaration
public bool CanSort { get; }
Property Value
System.Boolean
|
Count
Gets the number of elements contained in the System.Collections.ICollection.
Declaration
public int Count { get; }
Property Value
System.Int32
|
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.Globalization.CultureInfo
The culture to use during sorting. |
CurrentAddItem
Gets the item that is being added during the current add transaction.
Declaration
public object CurrentAddItem { get; }
Property Value
System.Object
The item that is being added if IsAddingNew is true; otherwise, null. |
CurrentEditItem
Gets the item in the collection that is being edited.
Declaration
public object CurrentEditItem { get; }
Property Value
System.Object
The item in the collection that is being edited if IsEditingItem is true; otherwise, null. |
CurrentItem
Gets the current item in the view.
Declaration
public object CurrentItem { get; }
Property Value
System.Object
|
CurrentPosition
Gets the ordinal position of the System.ComponentModel.ICollectionView.CurrentItem within the view.
Declaration
public int CurrentPosition { get; }
Property Value
System.Int32
|
DescriptorsSynchronizationMode
Gets or sets a value that controls how this DataItemCollection synchronizes its FilterDescriptors, GroupDescriptor and SortDescriptors, as well as GroupDescription and SortDescriptions (if applicable), with its source.
Declaration
public SynchronizationMode DescriptorsSynchronizationMode { get; set; }
Property Value
SynchronizationMode
|
Filter
Gets or sets a callback used to determine if an item is suitable for inclusion in the view.
Declaration
public Predicate<object> Filter { get; set; }
Property Value
System.Predicate<System.Object>
|
FilterDescriptors
Gets the filter descriptors used for filtering operations.
Declaration
public CompositeFilterDescriptorCollection FilterDescriptors { get; }
Property Value
CompositeFilterDescriptorCollection
The filter descriptors. |
Implements
GroupDescriptions
Gets a collection of System.ComponentModel.GroupDescription objects that describe how the items in the collection are grouped in the view.
Declaration
public ObservableCollection<GroupDescription> GroupDescriptions { get; }
Property Value
System.Collections.ObjectModel.ObservableCollection<System.ComponentModel.GroupDescription>
|
GroupDescriptors
Gets the group descriptors used for grouping operations.
Declaration
public GroupDescriptorCollection GroupDescriptors { get; }
Property Value
GroupDescriptorCollection
The group descriptors. |
Implements
Groups
Gets the top-level groups.
Declaration
public ReadOnlyObservableCollection<object> Groups { get; }
Property Value
System.Collections.ObjectModel.ReadOnlyObservableCollection<System.Object>
|
IsAddingNew
Gets a value that indicates whether an add transaction is in progress.
Declaration
public bool IsAddingNew { get; }
Property Value
System.Boolean
true if an add transaction is in progress; otherwise, false. |
IsCurrentAfterLast
Gets a value that indicates whether the System.ComponentModel.ICollectionView.CurrentItem of the view is beyond the end of the collection.
Declaration
public bool IsCurrentAfterLast { get; }
Property Value
System.Boolean
|
IsCurrentBeforeFirst
Gets a value that indicates whether the System.ComponentModel.ICollectionView.CurrentItem of the view is beyond the beginning of the collection.
Declaration
public bool IsCurrentBeforeFirst { get; }
Property Value
System.Boolean
|
IsEditingItem
Gets a value that indicates whether an edit transaction is in progress.
Declaration
public bool IsEditingItem { get; }
Property Value
System.Boolean
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.Boolean
|
IsPageChanging
Gets a value that indicates whether a page index change is in process.
Declaration
public bool IsPageChanging { get; }
Property Value
System.Boolean
true if the page index is changing; otherwise, false. |
Item[Int32]
Gets or sets the System.Object at the specified index.
Declaration
public object this[int index] { get; set; }
Parameters
System.Int32
index
|
Property Value
System.Object
|
ItemCount
Gets the minimum number of items known to be in the source collection.
Declaration
public int ItemCount { get; }
Property Value
System.Int32
The minimum number of items known to be in the source collection. |
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.Collections.ObjectModel.ReadOnlyCollection<ItemPropertyInfo>
A collection of objects that describes the properties of the items in the collection. |
Implements
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.Collections.Generic.Dictionary<System.String, ItemPropertyInfo>
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.Type
The type of the item. |
NewItemPlaceholderPosition
Gets or sets the position of the new item placeholder in the collection.
Declaration
public NewItemPlaceholderPosition NewItemPlaceholderPosition { get; set; }
Property Value
System.ComponentModel.NewItemPlaceholderPosition
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; }
Property Value
System.Int32
The zero-based index of the current page. |
PageSize
Gets or sets the number of items to display on a page.
Declaration
public int PageSize { get; set; }
Property Value
System.Int32
The number of items to display on a page. |
SortDescriptions
Gets a collection of System.ComponentModel.SortDescription objects that describe how the items in the collection are sorted in the view.
Declaration
public SortDescriptionCollection SortDescriptions { get; }
Property Value
System.ComponentModel.SortDescriptionCollection
|
SortDescriptors
Gets the sort descriptors used for sorting operations.
Declaration
public SortDescriptorCollection SortDescriptors { get; }
Property Value
SortDescriptorCollection
The sort descriptors. |
Implements
SourceCollection
Returns the underlying collection.
Declaration
public IEnumerable SourceCollection { get; }
Property Value
System.Collections.IEnumerable
|
TotalItemCount
Gets the total number of items in the source collection, or -1 if the total number is unknown.
Declaration
public int TotalItemCount { get; }
Property Value
System.Int32
The total number of items in the source collection, or -1 if the total number is unknown. |
Methods
Add(Object)
Adds an item to the System.Collections.IList.
Declaration
public int Add(object value)
Parameters
System.Object
value
The System.Object to add to the System.Collections.IList. |
Returns
System.Int32
The position into which the new element was inserted. |
Exceptions
System.NotSupportedException
The System.Collections.IList is read-only. -or- The System.Collections.IList has a fixed size. |
AddNew()
Adds a new item to the collection.
Declaration
public object AddNew()
Returns
System.Object
The new item that is added to the collection. |
Exceptions
System.InvalidOperationException
CanAddNew is false. |
AddNewItem(Object)
Adds the specified object to the collection.
Declaration
public virtual object AddNewItem(object newItem)
Parameters
System.Object
newItem
The object to add to the collection. |
Returns
System.Object
|
Implements
CancelEdit()
Ends the edit transaction and discards any pending changes to the item.
Declaration
public void CancelEdit()
Exceptions
System.InvalidOperationException
CancelEdit is not supported for the current edit item. Only items implementing System.ComponentModel.IEditableObject are supported. |
CancelNew()
Ends the add transaction and discards the pending new item.
Declaration
public void CancelNew()
Clear()
Removes all items from the System.Collections.IList.
Declaration
public void Clear()
Exceptions
System.NotSupportedException
The System.Collections.IList is read-only. |
CommitEdit()
Ends the edit transaction and saves the pending changes.
Declaration
public void CommitEdit()
CommitNew()
Ends the add transaction and saves the pending new item.
Declaration
public void CommitNew()
Contains(Object)
Determines whether the System.Collections.IList contains a specific value.
Declaration
public bool Contains(object value)
Parameters
System.Object
value
The System.Object to locate in the System.Collections.IList. |
Returns
System.Boolean
True if the System.Object is found in the System.Collections.IList; otherwise, false. |
CopyTo(Array, Int32)
Copies the elements of the System.Collections.ICollection to an System.Array, starting at a particular System.Array index.
Declaration
public void CopyTo(Array array, int index)
Parameters
System.Array
array
The one-dimensional System.Array that is the destination of the elements copied from System.Collections.ICollection. The System.Array must have zero-based indexing. |
System.Int32
index
The zero-based index in |
Exceptions
System.ArgumentNullException
|
System.ArgumentOutOfRangeException
|
System.ArgumentException
|
System.ArgumentException
The type of the source System.Collections.ICollection cannot be cast automatically to the type of the destination |
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.IDisposable
An System.IDisposable object that you can use to dispose of the calling object. |
EditItem(Object)
Begins an edit transaction of the specified item.
Declaration
public void EditItem(object item)
Parameters
System.Object
item
The item to edit. |
GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
public IEnumerator GetEnumerator()
Returns
System.Collections.IEnumerator
An System.Collections.IEnumerator object that can be used to iterate through the collection. |
IndexOf(Object)
Determines the index of a specific item in the System.Collections.IList.
Declaration
public int IndexOf(object value)
Parameters
System.Object
value
The System.Object to locate in the System.Collections.IList. |
Returns
System.Int32
The index of |
Insert(Int32, Object)
Inserts an item to the System.Collections.IList at the specified index.
Declaration
public void Insert(int index, object value)
Parameters
System.Int32
index
The zero-based index at which |
System.Object
value
The System.Object to insert into the System.Collections.IList. |
Exceptions
System.ArgumentOutOfRangeException
|
System.NotSupportedException
The System.Collections.IList is read-only. -or- The System.Collections.IList has a fixed size. |
System.NullReferenceException
|
MoveCurrentTo(Object)
Sets the specified item to be the System.ComponentModel.ICollectionView.CurrentItem in the view.
Declaration
public bool MoveCurrentTo(object item)
Parameters
System.Object
item
The item to set as the System.ComponentModel.ICollectionView.CurrentItem. |
Returns
System.Boolean
True if the resulting System.ComponentModel.ICollectionView.CurrentItem is within the view; otherwise, false. |
MoveCurrentToFirst()
Sets the first item in the view as the System.ComponentModel.ICollectionView.CurrentItem.
Declaration
public bool MoveCurrentToFirst()
Returns
System.Boolean
True if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false. |
MoveCurrentToLast()
Sets the last item in the view as the System.ComponentModel.ICollectionView.CurrentItem.
Declaration
public bool MoveCurrentToLast()
Returns
System.Boolean
True if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false. |
MoveCurrentToNext()
Sets the item after the System.ComponentModel.ICollectionView.CurrentItem in the view as the System.ComponentModel.ICollectionView.CurrentItem.
Declaration
public bool MoveCurrentToNext()
Returns
System.Boolean
True if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false. |
MoveCurrentToPosition(Int32)
Sets the item at the specified index to be the System.ComponentModel.ICollectionView.CurrentItem in the view.
Declaration
public bool MoveCurrentToPosition(int position)
Parameters
System.Int32
position
The index to set the System.ComponentModel.ICollectionView.CurrentItem to. |
Returns
System.Boolean
True if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false. |
MoveCurrentToPrevious()
Sets the item before the System.ComponentModel.ICollectionView.CurrentItem in the view as the System.ComponentModel.ICollectionView.CurrentItem.
Declaration
public bool MoveCurrentToPrevious()
Returns
System.Boolean
True if the resulting System.ComponentModel.ICollectionView.CurrentItem is an item within the view; otherwise, false. |
MoveToFirstPage()
Sets the first page as the current page.
Declaration
public bool MoveToFirstPage()
Returns
System.Boolean
true if the operation was successful; otherwise, false. |
MoveToLastPage()
Sets the last page as the current page.
Declaration
public bool MoveToLastPage()
Returns
System.Boolean
true if the operation was successful; otherwise, false. |
MoveToNextPage()
Moves to the page after the current page.
Declaration
public bool MoveToNextPage()
Returns
System.Boolean
true if the operation was successful; otherwise, false. |
MoveToPage(Int32)
Requests a page move to the page at the specified index.
Declaration
public bool MoveToPage(int pageIndex)
Parameters
System.Int32
pageIndex
The index of the page to move to. |
Returns
System.Boolean
true if the move was successfully initiated; otherwise, false. |
MoveToPreviousPage()
Moves to the page before the current page.
Declaration
public bool MoveToPreviousPage()
Returns
System.Boolean
true if the operation was successful; otherwise, false. |
OnPropertyChanged(PropertyChangedEventArgs)
Raises the PropertyChanged event.
Declaration
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters
System.ComponentModel.PropertyChangedEventArgs
e
The System.ComponentModel.PropertyChangedEventArgs instance containing the event data. |
Refresh()
Recreates the view.
Declaration
public void Refresh()
Remove(Object)
Removes the specified item from the collection.
Declaration
public void Remove(object item)
Parameters
System.Object
item
The item to remove. |
RemoveAt(Int32)
Removes the item at the specified position from the collection.
Declaration
public void RemoveAt(int index)
Parameters
System.Int32
index
The position of the item to remove. |
Events
CollectionChanged
Occurs when the collection changes.
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
System.Collections.Specialized.NotifyCollectionChangedEventHandler
|
CurrentChanged
When implementing this interface, raise this event after the current item has been changed.
Declaration
public event EventHandler CurrentChanged
Event Type
System.EventHandler
|
CurrentChanging
When implementing this interface, raise this event before changing the current item. Event handler can cancel this event.
Declaration
public event CurrentChangingEventHandler CurrentChanging
Event Type
System.ComponentModel.CurrentChangingEventHandler
|
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.EventHandler<NotifyGroupCollectionChangedEventArgs>
|
PageChanged
Occurs when the PageIndex has changed.
Declaration
public event EventHandler<EventArgs> PageChanged
Event Type
System.EventHandler<System.EventArgs>
|
PageChanging
Occurs when the PageIndex is changing.
Declaration
public event EventHandler<PageChangingEventArgs> PageChanging
Event Type
System.EventHandler<System.ComponentModel.PageChangingEventArgs>
|
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.ComponentModel.PropertyChangedEventHandler
|