BaseCollection<T>
Provides a state-managed generic collection base for RadMultiSelect related item collections.
Handles view state tracking for contained items that implement IMarkableStateManager.
Use this as a foundation for strongly-typed collections (e.g. MultiSelectItemCollection) that need:
- ASP.NET ViewState persistence
- Dirty-state propagation (so only changed items re-serialize)
- Familiar IList-like operations (Add / Insert / Remove / Contains / IndexOf)
Search phrases: "RadMultiSelect custom collection", "state managed collection items", "track item viewstate".
Definition
Namespace:Telerik.Web.UI.MultiSelect
Assembly:Telerik.Web.UI.dll
Type Parameters:
T
Item type stored by the collection.
Must implement IMarkableStateManager so changes can mark ViewState dirty.
Example: MultiSelectItemCollection : BaseCollection<MultiSelectItem>.
Syntax:
public abstract class BaseCollection<T> : StateManagedCollection, IList, ICollection, IStateManager, IEnumerable<T>, IEnumerable where T : class, IMarkableStateManager
Inheritance: objectStateManagedCollectionBaseCollection<T>
Derived Classes:
Implements:
Inherited Members
Constructors
public BaseCollection()
Properties
public RadMultiSelect Owner { get; }
Methods
Append a single item to the end of the collection. Example:
items.Add(new MultiSelectItem("Text","Value"));
public virtual void Add(T entity)
Item to add (must not be null).
Append a sequence of items efficiently (avoids repeated caller loops).
Example: collection.AddRange(sourceList);
public virtual void AddRange(IEnumerable<T> entities)
Enumerable of items to add.
protected virtual void Remove(T item)