Multiple comboboxes bound to same datasource

  • Thread starter Thread starter Mike Palmer
  • Start date Start date
M

Mike Palmer

I have multiple ComboBox controls bound to the same
DataSource (a DataSet). The DataValue and DataMember
properties are all bound to the same columns of the
DataSet. The SelectedValue properties of the ComboBoxes
are each bound to unique columns of another DataSet (a
different DataSet from the DataSource property).

When I change the value of any of the ComboBoxes (by
selecting a different item from the drop down), the value
of all up the ComboBoxes update to this newly selected
value.

How can I get rid of this behavior? I want each ComboBox
to be populated with the same data, but be able to each
have a different value selected...

Thanks,

Mike
 
Hi,
I am not sure if U have done some typo errors. But
certainly DataSets does not have columns
Looks like U are binding a single DataTable to multiple
comboboxes, in such case this problem is likely to occur,
so U need to create multiple copies of the DataTable for
each of ur comboboxes and bind the same.
In short, each combobox should have its Datasource instance

Regards
Mahesh
 
I'm a bit new at this, but here's a guess...
Can you use the SelectedValue?
The DataSource for each would be the same, then,

SelectedValue = '<%# DataBinder.Eval(Container.DataItem, "field_name")%>'
or
SelectedValue = '<%# view_name%>'


Drew
 
To get rid of ComboBox Synchronized Swimming, you need to
set up DataViews of your DataSet and bind each of the
comboboxes to its own dataview.
JT
 
Thanks! Worked like a charm...
-----Original Message-----
To get rid of ComboBox Synchronized Swimming, you need to
set up DataViews of your DataSet and bind each of the
comboboxes to its own dataview.
JT
.
 
Back
Top