I've two combobox in my win form and i try to bind them to a city table in my dataset.the problem is this:
When I try to change one combobox the other one's value also changes and i don't want this becuse one combobox is for working city and the other is Born Place
Thanks in advance
06-09-2004, 08:23 AM
This is because, by default, all controls on a form use the form's BindingContext. Add the following code to your form:
cboManager.BindingContext = New BindingContext
cboAssistant.BindingContext = New BindingContext
(This is assuming your problem combos are called cboManager/cboAssistant).
Of course, you only really have to create a new binding context for one of the combos for them to be using different contexts, I just like to treat mine consistently :-)
06-09-2004, 09:21 AM
You can also create a copy of the dataset and then bind this copy. This works fine.