I want to use the user-selected rows from one DataGridView as the DataSource for a second DataGridView. Note both DataGridViews will have identical columns.
Obviously I can iterate over the selected rows, obtain the key values, and re-query the database for a List to use as the DataSource of the 2nd grid, but that seems lame.
Surely there is an elegant way of simply re-using the SelectedRows collection as a DataSource?
SelectedRows
is a simple collection without notifications (compared toBindingSource
), so you will have to in any case handle event when it's changed (rised byDataGridView
) to at least updateBindingSource
. – Sinatr