Databindings Question

  • Thread starter Thread starter whaletyr
  • Start date Start date
W

whaletyr

If have a problem

I have 2 comboboxed on the same form
both are filled with the same data. with datasource and displaymember in
the properties defiened.

My problem is that if I select 1 item in combobox1 combobox 2 also chanches
but I dont want that.. where should i look for an answer to this problem?

Thanks
Whaletyr
 
Hi Whaletyr,

This is happening because they both point to the same data source, so they
both use the same CurrencyManager. Here are a couple ideas:

You could manually add items by looping through the data source's rows
without actually binding the combo box.

Also, you could copy the data source (I assume it's a data table?) to create
a new data table. Then set your second combo box's data source property to
this table. Doing this will use a different CurrencyManager, so the combo
box's values will not always be synchronized.

There is probably some more efficient, automagic way to bind to a data
source and then disconnect, but I haven't stumbled upon that yet.

Hope this helps you...

Eric
 
Back
Top