There is a DataGridView dgv ,
dgv.DataSource = myDateTable; There is a line selection code
private static void SelectRowByOrderID(DataGridView dgv, string orderID) { dgv.Rows .OfType<DataGridViewRow>() .Where(x => (string)x.Cells["#"].Value == orderID) .ToArray<DataGridViewRow>()[0] .Selected = true; } Actions:
- select row X;
- open the edit form;
- save changes in the database;
- close the edit form;
- update
myDateTabletable - update
dgv.DataSource
Question:
- how after
dgvupdate select line x?

dgv? - default localedgv.DataSource? Why is it impossible to immediately select lines there? - default localemyDateTable(read fromOleDbDataReader), is not anObservalableCollection. At the moment, I decided this way: after the editing form is closed, the method is called, which reads the data from the database again, draws the grid, moves the cursor to the X line. Now the question is: how not only to move the cursor to the X line, but also to restore the vertical level after the update scrolled. - Aleksandr H.