Class
ReadOnlyControlCollection

A control collection that can be set to read-only mode to prevent modifications.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public class ReadOnlyControlCollection : Control.ControlCollection, IList, ICollection, IEnumerable, ICloneable

Inheritance: objectArrangedElementCollectionControl.ControlCollectionReadOnlyControlCollection

Derived Classes: ContainerControlBase.ContainerTypedControlCollection

Implements: ICloneableICollectionIEnumerableIList

Inherited Members Control.ControlCollection.ContainsKey(string)Control.ControlCollection.AddRange(Control[])Control.ControlCollection.Contains(Control)Control.ControlCollection.Find(string, bool)Control.ControlCollection.GetEnumerator()Control.ControlCollection.IndexOf(Control)Control.ControlCollection.IndexOfKey(string)Control.ControlCollection.Remove(Control)Control.ControlCollection.RemoveAt(int)Control.ControlCollection.GetChildIndex(Control)Control.ControlCollection.GetChildIndex(Control, bool)Control.ControlCollection.SetChildIndex(Control, int)Control.ControlCollection.OwnerControl.ControlCollection.this[int]Control.ControlCollection.this[string]ArrangedElementCollection.Equals(object)ArrangedElementCollection.GetHashCode()ArrangedElementCollection.CopyTo(Array, int)ArrangedElementCollection.Count

Constructors

ReadOnlyControlCollection(Control, bool)

Initializes a new instance of the ReadOnlyControlCollection class.

Declaration

cs-api-definition
public ReadOnlyControlCollection(Control owner, bool isReadOnly)

Parameters

owner

Control

The control that owns this collection.

isReadOnly

bool

true to make the collection read-only; otherwise, false.

Properties

IsReadOnly

Declaration

cs-api-definition
public override bool IsReadOnly { get; }

Property Value

bool

Overrides ArrangedElementCollection.IsReadOnly

Methods

Add(Control)

Adds a control to the collection, throwing an exception if the collection is read-only.

Declaration

cs-api-definition
public override void Add(Control value)

Parameters

value

Control

The control to add to the collection.

Exceptions

NotSupportedException

Thrown when the collection is read-only.

Overrides Control.ControlCollection.Add(Control)

AddInternal(Control)

Adds a control to the collection without checking read-only status.

Declaration

cs-api-definition
public virtual void AddInternal(Control value)

Parameters

value

Control

The control to add to the collection.

Remarks

This method bypasses the read-only check and is used internally when controlled modifications are needed.

Clear()

Declaration

cs-api-definition
public override void Clear()

Overrides Control.ControlCollection.Clear()

RemoveByKey(string)

Declaration

cs-api-definition
public override void RemoveByKey(string key)

Parameters

key

string

Overrides Control.ControlCollection.RemoveByKey(string)

RemoveInternal(Control)

Declaration

cs-api-definition
public virtual void RemoveInternal(Control value)

Parameters

value

Control