I need to force the DataGridView
to show the selected row
.
In short, I have a textbox
that changes the DGV
selection based on what is typed into the textbox
. When this happens, the selection changes to the matching row
.
Unfortunately if the selected row
is out of the view, I have to manually scroll down to find the selection. Does anyone know how to force the DGV
to show the selected row
?
Thanks!
// This works, it's case sensitive and finds the first occurrence of search
Please note that setting FirstDisplayedScrollingRowIndex when your DataGridView is not enabled will scroll the list to desired row, but scrollbar will not reflect its position. Simpliest solution is re-enabling and disabling your DGV.
This one scrolls to the selected row without put it on top.