Set grid.PageMode = false.
In PageMode = true, the grid only has the visible rows, so it can't keep the selection in invisible rows.
Set grid.PageMode = false.
In PageMode = true, the grid only has the visible rows, so it can't keep the selection in invisible rows.