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!

How do I change combobox datasource?

Status
Not open for further replies.

Beeble

Programmer
Jun 12, 2001
7
GB
Hi,
Can anyone help me? I want to change the datasource of a combobox on the fly so that I get different data. I have tried :
combobox1.datasource = dataview1
combobox1.displaymember = "col1"

and then
combobox1.datasource = dataview2
combobox1.displaymember = "col2"

but the combobox display doesn't change at all and looking in the watch window the properties don't change.
I'm probably missing something obvious? Any help appreciated.
Beeble
:-(
 
What you have should work fine but to update the data shown make sure to call the .databind() command again. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Many thanks,
I discovered I was just being stoopid and the change was working but then some other code was immediatley restting the datasource.
Sorry for wasting your time and thanks again.
Beeble
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top