New to Telerik UI for WinFormsStart a free 30-day trial

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

Definition

Constructors

Initializes a new instance of the ReadOnlyControlCollection class.

C#
public ReadOnlyControlCollection(Control owner, bool isReadOnly)
Parameters:ownerControl

The control that owns this collection.

isReadOnlybool

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

Properties

C#
public override bool IsReadOnly { get; }

Overrides: ArrangedElementCollection.IsReadOnly

Methods

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

C#
public override void Add(Control value)
Parameters:valueControl

The control to add to the collection.

Exceptions:

NotSupportedException

Thrown when the collection is read-only.

Overrides: Control.ControlCollection.Add(Control)

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

C#
public virtual void AddInternal(Control value)
Parameters:valueControl

The control to add to the collection.

Remarks:

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

C#
public override void Clear()

Overrides: Control.ControlCollection.Clear()

C#
public override void RemoveByKey(string key)
Parameters:keystring

Overrides: Control.ControlCollection.RemoveByKey(string)

C#
public virtual void RemoveInternal(Control value)
Parameters:valueControl