We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataBoundGrid preserve view

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

1 Reply

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);

Loader.
Live Chat Icon For mobile
Up arrow icon