MoreThanDoubled
asked on
Get value from combo box
Hi all,
I am not sure why this is not working but i have two combo boxes.
When i select a value from the 1st combo box i would like the second combo to get populated based on what is in the 1st combo box.
the problem that i am having is that i cannot get the value from the first combo box when i click on the second combo box.
I tried using the FindControl function to get the value but its not working.
I am using C# , VS 2010
Any suggestions?
Thanks
I am not sure why this is not working but i have two combo boxes.
When i select a value from the 1st combo box i would like the second combo to get populated based on what is in the 1st combo box.
the problem that i am having is that i cannot get the value from the first combo box when i click on the second combo box.
I tried using the FindControl function to get the value but its not working.
I am using C# , VS 2010
Any suggestions?
Thanks
Are you using ASP.NET? if so, you want a cascading drop down list. See this article: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx
or is just like this one:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox2.SelectedItem = comboBox1.SelectedItem;
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox1.SelectedItem = comboBox2.SelectedItem;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.