Provides access to the items in a RadListView through its active collection view. Adding an item assigns it to this list view and updates the selected and checked item collections when the corresponding item state is already set.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class ListViewDataItemCollection : IList, ICollection, IEnumerable, INotifyCollectionChanged
Inheritance: objectListViewDataItemCollection
Implements:
Constructors
Creates a collection that uses the specified list view element as its item source.
public ListViewDataItemCollection(RadListViewElement owner)
The element whose items and collection view this collection exposes.
Properties
Gets the number of items in the active collection view.
public int Count { get; }
Implements:
Gets whether this collection has a fixed size. The list view item collection can grow or shrink.
public bool IsFixedSize { get; }
Implements:
Gets whether the backing list source is read-only.
public bool IsReadOnly { get; }
Implements:
Gets whether access to the backing list source is synchronized.
public bool IsSynchronized { get; }
Implements:
Gets the synchronization object used by the backing list source.
public object SyncRoot { get; }
Implements:
Gets or replaces an item at a position in the active collection view.
public ListViewDataItem this[int index] { get; set; }
The zero-based position in the active view.
Property Value:The item at the specified position.
Methods
Adds an item, removing it from its previous list view first when necessary.
Creates an item, assigns the supplied objects to its indexed sub-item values, and adds it to the list view.
public void Add(params object[] values)
The objects to assign to the new item's sub-item values in order.
Creates an item, assigns the supplied strings to its indexed sub-item values, and adds it to the list view.
public void Add(params string[] values)
The strings to assign to the new item's sub-item values in order.
Adds the specified items while the backing list source is in an update batch.
public virtual void AddRange(params ListViewDataItem[] listViewDataItems)
The items to add.
Creates and adds one item for each supplied text value while the backing list source is in an update batch.
public virtual void AddRange(params string[] values)
The display text values for the items to create.
Begins a batch of changes to the backing list source. Pair this call with EndUpdate() after the batch is complete.
public void BeginUpdate()
Removes all items from the backing list source and clears each item's owner reference.
public void Clear()
Implements:
Determines whether the active collection view contains the specified item.
public bool Contains(ListViewDataItem item)
The item to locate.
Returns:true if the item is present in the active view; otherwise, false.
Determines whether the active collection view contains the specified object. Non-ListViewDataItem values are not considered items in this collection.
Copies the items in the active collection view into an array.
public void CopyTo(ListViewDataItem[] array, int arrayIndex)
The destination array.
arrayIndexintThe zero-based destination index at which copying begins.
Ends the current batch of changes to the backing list source and allows its updates to be processed.
public void EndUpdate()
Enumerates the items in the active collection view.
public IEnumerator<ListViewDataItem> GetEnumerator()
IEnumerator<ListViewDataItem>
An enumerator over the items currently exposed by the view.
Finds the item's position in the active collection view, which may reflect the view's sorting or filtering.
public int IndexOf(ListViewDataItem item)
The item to locate.
Returns:The item's zero-based position, or -1 if it is not in the active view.
Inserts an item at the specified position and transfers it from another list view if it already has a different owner.
public void Insert(int index, ListViewDataItem item)
The zero-based position at which to insert the item.
itemListViewDataItemThe item to insert.
Exceptions: InvalidOperationExceptionThe list view is data-bound and does not allow programmatic insertion.
Inserts the value when it is a ListViewDataItem; values of other types are ignored.
Forwards a collection-view change to subscribers of CollectionChanged.
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
The change details raised by the collection view.
Removes the item and clears its owner, selection, and check state registrations. If the removed item is selected, the collection selects an adjacent item when possible.
public bool Remove(ListViewDataItem item)
The item to remove.
Returns:true if the backing list source removed the item; otherwise, false.
Removes the value when it is a ListViewDataItem; values of other types are ignored.
Removes the item at the specified position in the active collection view.
public void RemoveAt(int index)
The zero-based position of the item to remove.
Implements:
Events
Occurs when the list view's active collection view changes.
public event NotifyCollectionChangedEventHandler CollectionChanged
Implements: