Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bind DropDownList from another DropDownList

Status
Not open for further replies.

tshad

Programmer
Jul 15, 2004
386
0
0
US
I have 3 dropdowns that are identical and I only want to hit the database once to fill them.

I have done this before but can't remember how to do it.

I want to fill one dropdown list and then fill the other dropdowns directly from the first dropdownlist, not from a dataset.

Thanks,

Tom
 
I want to fill one dropdown list and then fill the other dropdowns directly from the first dropdownlist, not from a dataset

I don't understand. Are you filling all 3 dropdowns with the same data? If so, why not just bind the dataset or datatable to each ddl? Or do you want to bind the other ddls based on a selection from the first ddl?
 
I am filling one dropdownlist with the data and then filling another with another set of data.

But it is done at a different time and I don't want to keep the dataset around or I could just use the same dataset.

But I found the code that does it:

ddlNameSearch.Items.AddRange(ddlNameSearchFilter.Items.OfType<ListItem>().ToArray());

Thanks,

Tom
 
I still don't understand what you are trying to do, but if that works for you than glad you found the answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top