-
Combobox binding problem
Hello
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
Behdad Khoshbin
-
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 :-)
-
Hi,
You can also create a copy of the dataset and then bind this copy. This works fine.
Regqrds
Lucas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|