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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox with dynamic datasource? 1

Status
Not open for further replies.

ookete

Programmer
Oct 5, 2004
180
US
I have a combo box with databinding to a dataset, but it's datasource should change depending on another field in the dataset. So for example, if the user scrolls to a record and the "Department" field is Quality, then only applicable employees show up in an Employee drop-down. When the user scrolls to another record where "Department" = Production, a different set of employees should be selectable from the drop-down.

How do I make a combobox datasource be dynamic like this based on another field in the same databinding dataset?

Thank you for any help.
 
just refill the dataadapter and datatable on the selectedvaluechanged of the second combobox.

Actually I would recommend subclassing the combobox and add that value as one of the properties.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Alright, I got it to work. However, now the databinding seems to be broken on the combobox. The datasource changes as I navigate records, but the selectedvalue is remaining as the first value in the list always.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top