Maintaining the currently selected row in a datagridview

When loading data from the database and then displaying it in the datagridview, the record pointer will point to the first row of the datagridview.

Is it possible to keep the record pointer to the currently selected row in the datagridview after updating the records?

0


a source to share


1 answer


I would keep the DataGridView.CurrentCellAddress (I forgot the type) before updating the DataGridView. After updating, check that the cell at this address is still valid. Then set DataGridView.CurrentCell to the cell at that address.



0


a source







All Articles