B
Brian Smith
I have 2 combos on a form which require to have the same set of values
in the dropdown, but bind to different values in the main DataTable.
So I set the datasources thus:
cboOldProvider.ComboBoxControl.DataSource = ds.ServiceProviders ;
cboOldProvider.ComboBoxControl.DisplayMember = "Description" ;
cboOldProvider.ComboBoxControl.ValueMember = "ProviderID" ;
cboNewProvider.ComboBoxControl.DataSource = ds.ServiceProviders ;
cboNewProvider.ComboBoxControl.DisplayMember = "Description" ;
cboNewProvider.ComboBoxControl.ValueMember = "ProviderID" ;
The I add bindings to values in the main datatable:
cboOldProvider.DataBindings.Add("SelectedValue", ds.LineItems,
"OldProviderID") ;
cboNewProvider.DataBindings.Add("SelectedValue", ds.LineItems,
"NewProviderID") ;
BUT, when I choose any value in either combobox, the other combo changes
to the same value. I can't make them different.
What is wrong with my code????
brian smith
in the dropdown, but bind to different values in the main DataTable.
So I set the datasources thus:
cboOldProvider.ComboBoxControl.DataSource = ds.ServiceProviders ;
cboOldProvider.ComboBoxControl.DisplayMember = "Description" ;
cboOldProvider.ComboBoxControl.ValueMember = "ProviderID" ;
cboNewProvider.ComboBoxControl.DataSource = ds.ServiceProviders ;
cboNewProvider.ComboBoxControl.DisplayMember = "Description" ;
cboNewProvider.ComboBoxControl.ValueMember = "ProviderID" ;
The I add bindings to values in the main datatable:
cboOldProvider.DataBindings.Add("SelectedValue", ds.LineItems,
"OldProviderID") ;
cboNewProvider.DataBindings.Add("SelectedValue", ds.LineItems,
"NewProviderID") ;
BUT, when I choose any value in either combobox, the other combo changes
to the same value. I can't make them different.
What is wrong with my code????
brian smith