Databinding 2 comboboxes to the same Datasource

  • Thread starter Thread starter ECathell
  • Start date Start date
E

ECathell

I am trying to databind 2 combo boxes to the same datasource but different fields using the same lookup table. The information in combobox2 is duplicating combobox 1(ie it appears to be gathering the wrong information) I have verified the proper information through query analyzer....

Me.FormatName1ComboBox.DataSource = LabelFormats

Me.FormatName1ComboBox.DisplayMember = "Formatname"

Me.FormatName1ComboBox.ValueMember = "FormatName"

Me.FormatName1ComboBox.DataBindings.Add(New Binding("SelectedValue", ProductsBindingsource, "FormatName1"))

Me.FormatName2ComboBox.DataSource = LabelFormats

Me.FormatName2ComboBox.DisplayMember = "Formatname"

Me.FormatName2ComboBox.ValueMember = "FormatName"

Me.FormatName2ComboBox.DataBindings.Add(New Binding("SelectedValue", ProductsBindingsource, "FormatName2"))
 
Hi,

The currency manager will keep the 2 comboboxes in sync when they
are bound to the same datasource. Create a dataview to bind one of the
comboboxes to.

Ken
 
A little addition before it is misunderstood

*New* dataview

Cor
 
so because they both have the same datasource(lookup table) they will stay
in sync? so really then I need to create a second instance of the lookup
datasource....ok...seem redundant since it is the SAME lookup datasource and
bound to different columns of the products datasource...
 
But as Ken said is the postion of the row by the currencymanager bound
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top