Two ComboBox in Grid, how to enable one based the other one

2 posts, 0 answers
  1. Helen
    Helen avatar
    4 posts
    Member since:
    Feb 2011

    Posted 10 Aug 2012 Link to this post


    I have two ComboBox comboA and comboB in Grid and initial comboB is disable.
    comboB  need to be enabled when comboA has a selected value?
    How can I do that without loop through each cell?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Aug 2012 Link to this post

    Hi,

    You can attach SelectedIndexChanged event to the comboA and enable comboB. Here is the sample code.
    C#:
    protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
       RadComboBox combo1 = (RadComboBox)sender;
       GridDataItem item = (GridDataItem)combo1.NamingContainer;
       RadComboBox combo2 = (RadComboBox)item.FindControl("RadComboBox2");
       combo2.Enabled = true;
    }

    Thanks,
    Shinu.
Back to Top