RadItemCollection
Represents a specialized collection that stores and manages RadItem objects with support for ownership relationships, change notifications, and hierarchical item management.
RadItemCollection extends CollectionBase to provide comprehensive collection management specifically designed for RadItem objects within the Telerik WinControls framework. The collection automatically handles parent-child relationships, item lifecycle events, and ensures proper integration with the element tree structure.
The collection supports batch operations through notification suspension, change event handling, and maintains the integrity of item hierarchies. It provides strongly-typed access to items and implements proper change notifications for UI updates and layout recalculation.
Each collection is typically owned by a RadElement that acts as the logical parent for all items in the collection. The collection enforces proper ownership relationships and handles cascading operations such as theme application and property inheritance.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class RadItemCollection : CollectionBase, IList, ICollection, IEnumerable
Inheritance: objectCollectionBaseRadItemCollection
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadItemCollectionBase class.
public RadItemCollection()
Initializes a new instance of RadItemCollection based on another RadItemCollection.
public RadItemCollection(RadItemCollection value)
A RadItemCollection from which the contents are copied.
Properties
Gets or sets the item type designated as the default for this collection.
public virtual Type DefaultType { get; set; }
Gets or sets an array of the excluded items' types for this collection.
[Browsable(false)]
public virtual Type[] ExcludedTypes { get; set; }
Gets the first item, or null when the collection is empty.
[Browsable(false)]
public RadItem First { get; }
Gets or sets an array of the items' types in the collection.
public virtual Type[] ItemTypes { get; set; }
Gets the last item, or null when the collection is empty.
[Browsable(false)]
public RadItem Last { get; }
Gets or sets an array of the sealed items' types for this collection. That are types that are allowed but not their descendants.
[Browsable(false)]
public virtual Type[] SealedTypes { get; set; }
Represents the entry at the specified index of the RadItem.
public virtual RadItem this[int index] { get; set; }
The zero-based index of the entry to locate in the collection.
Property Value:The entry at the specified index of the collection.
Exceptions: ArgumentOutOfRangeExceptionindex is outside the valid range of indexes for the collection.
Gets the first found item, with Name property equal to itemName specified, case-sensitive.
public virtual RadItem this[string itemName] { get; }
item Name
Property Value:RadItem if found, null (Nothing in VB.NET) otherwise
Methods
Adds the contents of another RadItemCollection to the end of the collection.
public void AddRange(RadItemCollection value)
A RadItemCollection containing the objects to add to the collection.
Copies the RadItemCollection values to a one-dimensional Array instance at the specified index.
public void CopyTo(RadItem[] array, int index)
The one-dimensional Array that is the destination of the values copied from RadItemCollection .
indexintThe index in array where copying begins.
array is multidimensional.
-or-
The number of elements in the RadItemCollection is greater than the available space between index and the end of array.
array is null.
index is less than array's lowbound.
Returns an enumerator that can iterate through the RadItemCollection .
public RadItemCollection.RadItemEnumerator GetEnumerator()
RadItemCollection.RadItemEnumerator
None.
Raises the clearing notification before the collection is emptied, unless notifications are suspended.
protected override void OnClear()
Overrides:
Raises the cleared notification after the collection has been emptied, unless notifications are suspended.
protected override void OnClearComplete()
Overrides:
Raises ItemsChanged unless notifications are suspended.
protected virtual void OnItemsChanged(RadItem target, ItemsChangeOperation operation)
The item associated with the operation, or null for collection-wide operations.
operationItemsChangeOperationThe operation phase being reported.
Raises the setting notification before an item is replaced, unless notifications are suspended.
Raises the set notification after an item has been replaced, unless notifications are suspended.
Raises the sorting notification before Sort() reorders the items, unless notifications are suspended.
protected virtual void OnSort()
Raises the sorted notification after Sort() reorders the items, unless notifications are suspended.
protected virtual void OnSortComplete()
Removes a specific RadItem from the RadItemCollection .
public void Remove(RadItem value)
The RadItem to remove from the RadItemCollection .
Exceptions: ArgumentExceptionvalue is not found in the Collection.
Removes one level of notification suspension, if any.
public void ResumeNotifications()
Calling this method when notifications are not suspended has no effect.
Sorts the elements in the entire RadElementCollection using the IComparable implementation of each element.
public void Sort()
Sorts the elements in the entire RadElementCollection using the specified comparer.
public void Sort(IComparer comparer)
The IComparer implementation to use when comparing elements.
Sorts the elements in a range of elements in RadElementCollection using the specified comparer.
Suppresses ItemsChanged notifications until the matching resumes are called.
public void SuspendNotifications()
Calls are nestable; each call to ResumeNotifications() removes one level of suspension.
Events
Fires when item is changed.
public event ItemChangedDelegate ItemsChanged