Datagrid Gotopage

Hi I have a data grid and an edit form on the same page and visibility is controlled by a boolean EditMode. After saving my record and setting EditMode to false the grid redisplays but it appears to go back to the first page. I tried calling Gotopage with the correct page Index but it doesn't seem to work in this scenario.

Any advice would be much appreciated. Thanks

I’m not sure what your implementation is however you can check our demo where the update will not reset the DataGrid to the first page:

Thanks for this however I have a separate form that displays when I click the edit button in the Grid rather than inline editing. While the form is displayed the grid is removed and then added back when either the form is cancelled or saved. When the grid is redisplayed it resets to page 1. I tried to use gotopage to go back to the page that it was on before but that doesn't work either. I read that GoToPage should reload the grid.

 protected void ExitEditMode()
 {
     EditMode = false;
     batchesGrid.GoToPage(pageIndex);
 }

Thanks for your help

Most probably this is causing the reset to first page since every time you create and bind the DataGrid from scratch. You might need to use save/load settings approach demonstrated on our demos.

Thank you so much that's solved my issue