Multiple comboboxes bound to same datasource

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
 
M

mahesh

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
 
S

ssoss

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
 
J

JT

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
 
M

Mike Palmer

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
.
 

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

Top