E
erobishaw
..NET 2.0:
I put two combo boxes in a Winform, and a DataGridView.
Create a DataSource using the Data Source creation wizard against a
Business class object, which creates a BindingSource object.
Assign the DataSource of all three controls to the same BindingSource
Object and:
1) Change the SelectedIndex on one combobox changes for the other, and
selects a diff. row in the DataGridView
2) Change the row in teh datagridView and the Selected Index in the 2
combo boxes change.
I know this is by design, but is there a way to avoid this using a
single BindingSource object?
I thought that by putting one of the comboboxes in a GroupBox and
explicitly setting the BindingContext to a new Binding Context this
would keep that comboBox from changing indexes, but that doesn't have
any effect...
Basically what I'm trying to accomplish:
- Be able to assign the same list to multiple controls
- When an item is ADDED or REMOVED from the list, the controls
automatically reflect the new list
- When an item whose DisplayMember is used in the list is changed, it
too reflects in the controls
- When a SelectedIndex changes for one control it DOES NOT change in
the others (unless I explicity set it).
In other words, do everything the BindingSource object accomplishes,
but without the SelectedIndex change reflecting in all controls.
I put two combo boxes in a Winform, and a DataGridView.
Create a DataSource using the Data Source creation wizard against a
Business class object, which creates a BindingSource object.
Assign the DataSource of all three controls to the same BindingSource
Object and:
1) Change the SelectedIndex on one combobox changes for the other, and
selects a diff. row in the DataGridView
2) Change the row in teh datagridView and the Selected Index in the 2
combo boxes change.
I know this is by design, but is there a way to avoid this using a
single BindingSource object?
I thought that by putting one of the comboboxes in a GroupBox and
explicitly setting the BindingContext to a new Binding Context this
would keep that comboBox from changing indexes, but that doesn't have
any effect...
Basically what I'm trying to accomplish:
- Be able to assign the same list to multiple controls
- When an item is ADDED or REMOVED from the list, the controls
automatically reflect the new list
- When an item whose DisplayMember is used in the list is changed, it
too reflects in the controls
- When a SelectedIndex changes for one control it DOES NOT change in
the others (unless I explicity set it).
In other words, do everything the BindingSource object accomplishes,
but without the SelectedIndex change reflecting in all controls.