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

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

1 Answer 20 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Helen
Top achievements
Rank 1
Helen asked on 11 Aug 2012, 01:43 AM

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?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Aug 2012, 05:50 AM
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.
Tags
ComboBox
Asked by
Helen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or