New to Telerik UI for WinForms? Start a free 30-day trial

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:

C#
public class ListViewDataItemCollection : IList, ICollection, IEnumerable, INotifyCollectionChanged

Inheritance: objectListViewDataItemCollection

Implements: ICollectionIEnumerableIListINotifyCollectionChanged

Constructors

Creates a collection that uses the specified list view element as its item source.

C#
public ListViewDataItemCollection(RadListViewElement owner)
Parameters:ownerRadListViewElement

The element whose items and collection view this collection exposes.

Properties

Gets the number of items in the active collection view.

C#
public int Count { get; }

Implements: ICollection.Count

Gets whether this collection has a fixed size. The list view item collection can grow or shrink.

C#
public bool IsFixedSize { get; }

Implements: IList.IsFixedSize

Gets whether the backing list source is read-only.

C#
public bool IsReadOnly { get; }

Implements: IList.IsReadOnly

Gets whether access to the backing list source is synchronized.

C#
public bool IsSynchronized { get; }

Implements: ICollection.IsSynchronized

Gets the synchronization object used by the backing list source.

C#
public object SyncRoot { get; }

Implements: ICollection.SyncRoot

Gets or replaces an item at a position in the active collection view.

C#
public ListViewDataItem this[int index] { get; set; }
Parameters:indexint

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.

C#
public void Add(ListViewDataItem item)
Parameters:itemListViewDataItem

The item to add.

Creates an item, assigns its value, and adds it to the list view.

C#
public void Add(object value)
Parameters:valueobject

The value assigned to the new item's Value property.

Creates an item, assigns the supplied objects to its indexed sub-item values, and adds it to the list view.

C#
public void Add(params object[] values)
Parameters:valuesobject[]

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.

C#
public void Add(params string[] values)
Parameters:valuesstring[]

The strings to assign to the new item's sub-item values in order.

Creates an item, assigns its display text, and adds it to the list view.

C#
public void Add(string text)
Parameters:textstring

The text assigned to the new item's Text property.

Adds the specified items while the backing list source is in an update batch.

C#
public virtual void AddRange(params ListViewDataItem[] listViewDataItems)
Parameters:listViewDataItemsListViewDataItem[]

The items to add.

Creates and adds one item for each supplied text value while the backing list source is in an update batch.

C#
public virtual void AddRange(params string[] values)
Parameters:valuesstring[]

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.

C#
public void BeginUpdate()

Removes all items from the backing list source and clears each item's owner reference.

C#
public void Clear()

Implements: IList.Clear()

Determines whether the active collection view contains the specified item.

C#
public bool Contains(ListViewDataItem item)
Parameters:itemListViewDataItem

The item to locate.

Returns:

bool

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.

C#
public bool Contains(object value)
Parameters:valueobject

The object to locate.

Returns:

bool

true if value is a contained list view item; otherwise, false.

Implements: IList.Contains(object)

Copies the backing list source items into an array.

C#
public void CopyTo(Array array, int index)
Parameters:arrayArray

The destination array.

indexint

The zero-based destination index at which copying begins.

Implements: ICollection.CopyTo(Array, int)

Copies the items in the active collection view into an array.

C#
public void CopyTo(ListViewDataItem[] array, int arrayIndex)
Parameters:arrayListViewDataItem[]

The destination array.

arrayIndexint

The 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.

C#
public void EndUpdate()

Enumerates the items in the active collection view.

C#
public IEnumerator<ListViewDataItem> GetEnumerator()
Returns:

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.

C#
public int IndexOf(ListViewDataItem item)
Parameters:itemListViewDataItem

The item to locate.

Returns:

int

The item's zero-based position, or -1 if it is not in the active view.

Finds the position of an object in the active collection view.

C#
public int IndexOf(object value)
Parameters:valueobject

The object to locate.

Returns:

int

The zero-based position, or -1 if the object is not a list view item in the active view.

Implements: IList.IndexOf(object)

Inserts an item at the specified position and transfers it from another list view if it already has a different owner.

C#
public void Insert(int index, ListViewDataItem item)
Parameters:indexint

The zero-based position at which to insert the item.

itemListViewDataItem

The item to insert.

Exceptions: InvalidOperationException

The 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.

C#
public void Insert(int index, object value)
Parameters:indexint

The zero-based position at which to insert the item.

valueobject

The value to insert.

Implements: IList.Insert(int, object)

Forwards a collection-view change to subscribers of CollectionChanged.

C#
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters:argsNotifyCollectionChangedEventArgs

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.

C#
public bool Remove(ListViewDataItem item)
Parameters:itemListViewDataItem

The item to remove.

Returns:

bool

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.

C#
public void Remove(object value)
Parameters:valueobject

The value to remove.

Implements: IList.Remove(object)

Removes the item at the specified position in the active collection view.

C#
public void RemoveAt(int index)
Parameters:indexint

The zero-based position of the item to remove.

Implements: IList.RemoveAt(int)

Events

Occurs when the list view's active collection view changes.

C#
public event NotifyCollectionChangedEventHandler CollectionChanged

Implements: INotifyCollectionChanged.CollectionChanged