Several ComboBox controls with one DataSource object affect each other on change #4627
-
Problem description: Such behavior doesn't seem to be documented and, imo, should be fixed. Also some other people's encounters: Expected behavior: Minimal repro:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Both your linked discussions have the correct solutions, I don't believe there is a bug. When you are assigning lists directly as data source WinForms will track the current selection for you, to support scenarios like master/detail views where the controls of the detail area need to respect the current selection of the master list. Obviously this can only work when the binding system coordinates between controls. If you want separate selection logic you should use separate Of course you can also do all of this in code, but here you also have an alternate solution (also suggested in your linked threads) to explicitly instruct WinForms to separate the controls by assigning them separate |
Beta Was this translation helpful? Give feedback.
Both your linked discussions have the correct solutions, I don't believe there is a bug.
When you are assigning lists directly as data source WinForms will track the current selection for you, to support scenarios like master/detail views where the controls of the detail area need to respect the current selection of the master list. Obviously this can only work when the binding system coordinates between controls.
If you want separate selection logic you should use separate
BindingSource
s instead of directly binding against a list. WinForms is a strongly designer-oriented framework so the "expected" way to do this in the designer is to place aBindingSource
in the designer for each "selec…