Link to home
Start Free TrialLog in
Avatar of thomehm
thomehmFlag for United States of America

asked on

Coordinating Multiple selected rows in multiple DataGridView

I have 3 DataGridView's which each reference a BindingSource that references a DataTable in a DataSet.  Each of the DataGridViews's displays a different set of the columns in the DataTable.  The BindingSource correctly coordinates the data shown in each DataGridView nicely, as expected.  The BindingSource also coordinates the CurrentRow to be the same in each DataGridView.  Very nice, as expected. However, as we know, the CurrentRow is not necessarily a selected row.  Furthermore, while we can have only one current row, we can have multiple selected rows.  I would like to set up my application so that each DataGridView will always show the same set of selected rows.  I know about the DataGridExposed members for SelectedRows, Selection Changed events.  I know I can make a row selected with the DataGridViewRow.Selected = true.  I have tried some programatic control of the Selected Rows, but because of the common BindingSource I get a lot of recursive events and the entire process soon gets quite messy and I just can't seem to get it to work right.  Any suggestions on how to approach this would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial