Class ReadOnlyControlCollection
A control collection that can be set to read-only mode to prevent modifications.
Inheritance
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
public class ReadOnlyControlCollection : Control.ControlCollection
Remarks
This collection extends the standard Control.ControlCollection with the ability to enforce read-only behavior. When in read-only mode, all modification operations throw exceptions, but internal methods can still be used for controlled modifications.
Constructors
ReadOnlyControlCollection(Control, Boolean)
Initializes a new instance of the ReadOnlyControlCollection class.
Declaration
public ReadOnlyControlCollection(Control owner, bool isReadOnly)
Parameters
System.Windows.Forms.Control
owner
The control that owns this collection. |
System.Boolean
isReadOnly
true to make the collection read-only; otherwise, false. |
Properties
IsReadOnly
Declaration
public override bool IsReadOnly { get; }
Property Value
System.Boolean
|
Methods
Add(Control)
Adds a control to the collection, throwing an exception if the collection is read-only.
Declaration
public override void Add(Control value)
Parameters
System.Windows.Forms.Control
value
The control to add to the collection. |
Exceptions
System.NotSupportedException
Thrown when the collection is read-only. |
AddInternal(Control)
Adds a control to the collection without checking read-only status.
Declaration
public virtual void AddInternal(Control value)
Parameters
System.Windows.Forms.Control
value
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
public override void Clear()
RemoveByKey(String)
Declaration
public override void RemoveByKey(string key)
Parameters
System.String
key
|
RemoveInternal(Control)
Declaration
public virtual void RemoveInternal(Control value)
Parameters
System.Windows.Forms.Control
value
|