Multiple Combo Boxes - Same Binding Source

J

Joe

Hi,

I have a rather form where the user enters address
information. It is entered in more than one place because it
represents different addresses for the same customer - like shipping
and billing. Both of these addresses contain a combo box so that the
use can select the state.

The state combo boxes get their dropdown lists from a States
table in the database. The data is retrieved into a typed dataset and
then bound to the form with a single binding source.

My problem is that whenever I select a state in one of the
combo boxes, the other combo box also jumps to the same value. Their
DataBindings Text properties are set to different fields in the
database because the billing state is indeed different than the
shipping state.

Does every combo box on a form have to have a separate binding
source? - even if the data is coming from the same table?

Any help appreciated.


Jim
 
J

Jack Jackson

Hi,

I have a rather form where the user enters address
information. It is entered in more than one place because it
represents different addresses for the same customer - like shipping
and billing. Both of these addresses contain a combo box so that the
use can select the state.

The state combo boxes get their dropdown lists from a States
table in the database. The data is retrieved into a typed dataset and
then bound to the form with a single binding source.

My problem is that whenever I select a state in one of the
combo boxes, the other combo box also jumps to the same value. Their
DataBindings Text properties are set to different fields in the
database because the billing state is indeed different than the
shipping state.

Does every combo box on a form have to have a separate binding
source? - even if the data is coming from the same table?

The problem is that both controls are using the same (default)
currency manager. You need to make one or both comboboxes use a
different currency manager.

This article
<http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.windowsforms/topic61944.aspx>
explains one way to do this.
 
R

RobinS

Easy solution: use a different binding source for each combobox. You can use
the same underlying dataset, but you have to have a different binding
source, or it changes the selected item on all of the comboboxes when you
change just one.

RobinS.
 

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