Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadListDataItemCollection : IList, ICollection, IEnumerable
Inheritance: objectRadListDataItemCollection
Derived Classes:
Implements:
Constructors
Initializes a collection backed by the specified data layer and owned by the list element.
public RadListDataItemCollection(ListDataLayer dataLayer, RadListElement ownerListElement)
The data layer that supplies the items and their current view.
ownerListElementRadListElementThe list element that receives item-change notifications.
Properties
Gets the number of items in the current view, or in the source when this collection does not use a view.
public int Count { get; }
Implements:
Gets the first item in the collection's current sequence, or null when the collection is empty.
public RadListDataItem First { get; }
Gets whether the underlying list source is read-only.
public bool IsReadOnly { get; }
Implements:
Gets the last item in the collection's current sequence, or null when the collection is empty.
public RadListDataItem Last { get; }
Gets the data layer that supplies this collection's source and view.
public ListDataLayer Owner { get; }
Gets the list element that owns this collection and coordinates item changes.
public RadListElement OwnerListElement { get; }
Gets an item from the current view, or replaces the item at the corresponding index in the underlying list source.
public RadListDataItem this[int index] { get; set; }
The item index.
Property Value:The item at the specified index.
When the view is sorted or filtered, the setter still treats
indexas a source index rather than a view index. The owner can cancel a replacement.
Methods
Adds an item to the list, unless the owner cancels the pending addition. For an unbound source the supplied instance is added; for a bound source a new item is created and its text is copied.
public virtual void Add(RadListDataItem item)
The item whose text or instance is used for the addition.
Creates an item with the specified display text and adds it to the list.
public virtual void Add(string itemText)
The text to display for the new item.
Adds a batch of items to the underlying list source. The owner receives a cancellable batch notification before the items are added. When the owner accepts the batch, the input is enumerated again to add the items.
public void AddRange(IEnumerable<RadListDataItem> range)
The items to add.
Exceptions: ArgumentNullExceptionrange is null.
The input must support repeated enumeration; a single-use sequence can produce the batch notification without adding its items. If the owner cancels the notification, the input is enumerated only to build that notification and no items are added.
Creates one RadListDataItem for each supplied string and adds the items as a batch.
public virtual void AddRange(IEnumerable<string> textStrings)
The display text for the items to add.
Exceptions: ArgumentNullExceptiontextStrings is null.
Removes all items, detaches them from the list, and clears the active and selected item state.
public void Clear()
Implements:
Determines whether the item is present in the current view, or in the source when this collection does not use a view.
public bool Contains(RadListDataItem item)
The item to find.
Returns:true if the item is present; otherwise, false.
Copies items to the destination array using arrayIndex as both the collection index and destination index.
Items before that collection index are not copied.
public void CopyTo(RadListDataItem[] array, int arrayIndex)
The destination array.
arrayIndexintThe first collection and destination-array index to copy.
Returns an enumerator over the current view, or over the source when this collection does not use a view.
public IEnumerator<RadListDataItem> GetEnumerator()
IEnumerator<RadListDataItem>
An enumerator for the items exposed by this collection.
Gets the item's index in the collection's exposed sequence, which is the data view when enabled and otherwise the source.
public int IndexOf(RadListDataItem item)
The item to locate.
Returns:The zero-based index, or -1 if the item is not in the exposed sequence.
Inserts an item into the underlying list source at the specified index. The owner can cancel the pending addition.
public void Insert(int index, RadListDataItem item)
The index at which to insert the item.
itemRadListDataItemThe item to insert.
Removes the specified item unless the owner cancels the operation.
public bool Remove(RadListDataItem item)
The item to remove.
Returns:true if the item was removed; otherwise, false.
Removes the item at the specified collection index, unless the owner cancels the pending removal.