Binding to Comboboxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I am writing an app in vb.net and bind 4 combobox controls to the same table
in the same dataset. What happens is that when I change the selection in any
of the 4 comboboxes, *all* off the comboboxes change to the same selection. I
have in no way coded it to do this! Can someone please point to me what I am
doing wrong and a possible solution?

Thanks ^_^
 
You have done nothing wrong. This is by design. You need to create 4
different DataView's of your DataTable and bind each ComboBox to a different
DataView.
 
Hello Tim Wilson" TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM,

Or, assign a different BindingContext to each ComboBox.

myComboBox.BindingContext = new BindingContext();
 
Thanks to you both!

I took Matt's approach which is quite interesting as its not an exposed
property. But worked beautifully :)
 
Hello Daisuke,

You'll find that it is an exposed property if you go to Tools | Options |
VB and uncheck Hide Advanced Members.

In all likliehood, you'll see a bunch of new things. Microsoft decided to
not show VB users all of the items available via Intellisense by default.
 
Back
Top