Hi,
I have a refresh of a gridview after which I select again the row which was selected for the refresh. That works fine.
However, the gridview has a long list of values, so when I select a value in the middle of the list and the scrollbar (vertical) is there and I do a refresh, the gridview should scroll to that value but it is not.
How can I do this, something like $datagridview01.Rows[$RowToSelect].Selected = $true for row then $datagridview01.Rows[$RowToSelect].SCROLLTOROW = $True?
Hope this is clear.
Please advise.
Refresh Gridview, focus on row selected in middle of grid (scrollbar)
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Refresh Gridview, focus on row selected in middle of grid (scrollbar)
https://docs.microsoft.com/en-us/dotnet ... ngRowIndex
$dataGridView1.FirstDisplayedScrollingRowIndex = $dataGridView1.SelectedRows[0].Index
$dataGridView1.FirstDisplayedScrollingRowIndex = $dataGridView1.SelectedRows[0].Index