Avatar of 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?


Avatar of undefined
Last Comment

8/22/2022 - Mon

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;

Open in new window

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question