This is a migrated thread and some comments may be shown as answers.

Hide radcombobox

1 Answer 74 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
DEBI
Top achievements
Rank 1
DEBI asked on 26 Nov 2013, 06:48 PM
Hello,

I have a web page with several comboboxes , trying to set the enabled property to false on page load with the following code:

  foreach (Telerik.Web.UI.RadComboBox p in this.Controls.OfType<Telerik.Web.UI.RadComboBox>())
            p.Enabled = false;

doesnt seem to work, can someone suggest the rightway??

Thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Nov 2013, 04:52 AM
Hi DEBI,

Please have a look into the following code snippet to disable all the RadComboBox in Page_Load event.

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server">
</telerik:RadComboBox>
<telerik:RadComboBox ID="RadComboBox2" runat="server">
</telerik:RadComboBox>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    foreach (var control in form1.Controls.OfType<RadComboBox>())
    {
        control.Enabled = false;
    }
}

Hope this will helps you.
Thanks,
Shinu.
Tags
ComboBox
Asked by
DEBI
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or