@ChrisC is correct, The RadGroupBox inherits from the control class, and the control class has a property Controls
.
public static void ControlsReadOnly(Control[] containerList, bool readOnlyStatus)
{
}
One thing I don't understand: Why do you look at the same control the number of times as the length of your array? Did you mean:
public static void ControlsReadOnly(Control[] containerList, bool readOnlyStatus)
{
for (int i = 0; i < containerList.Length; i++)
{
var control = containerList[i];
//... omitted code for brevity
}
}
Finally, I don't know if this helps, but any Control can be Enabled
. This might help keep the access consistent, such that you might be able to do something like this:
public static void ControlsReadOnly(Control[] containerList, bool readOnlyStatus)
{
foreach (var control in container.Controls)
{
foreach (var control in container.Controls)
{
if((control as RadTextBox) != null)
{
control.Enabled = !readOnlyStatus;
}
}
}
}
I hope this helps!
Sources:
http://www.telerik.com/help/winforms/t_telerik_wincontrols_ui_radgroupbox.html http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx