NG
Nick Gardner
October 5, 2006 01:55 PM UTC
>Hi, in a GridDataBoundgrid I want to get the current top row index so that I can preserve the current view after an update. E.g. if the grid is currently showing rows 7 to 20 and has row 14 selected, I''d like to be able to completely redraw the grid, then set the view back such that rows 7 to 20 are displayed with row 14 selected.
Thanks,
Nick
Resolved. For anyone interested:
int topRowIndex = queryResultsGrid.TopRowIndex;
int selectedRowIndex = queryResultsGrid.CurrentCell.RowIndex;
// do stuff
queryResultsGrid.TopRowIndex = topRowIndex;
queryResultsGrid.CurrentCell.MoveTo (selectedRowIndex, 0, Syncfusion.Windows.Forms.Grid.GridSetCurrentCellOptions.SetFocus);