Hi! does anybody know how can I get a grid back to the first page after changing de page size? the problem is that if I change the page size to a smaller one when I am at the last page, it becomes empty because it has no rows to display.
Thanks!
That was the problem, I already fixed it. Thank you all.
It really depends on where you are using this code - if it is in Page_Load - it will get executed always and the grid will always be on page one. You need to use it only in the postback event handler of the respective button / server control you are using.
Is this the case? If not, posting some of your code will surely provide additional clues.
Thank you! but when I do that, the grid gets stuck at the first page. I cannot navigate through the pages. I set the property before setting the datasource. Do you have any idea about what´s happening?
Set the grid's DisplayLayout.Pager.CurrentPageIndex property to 1, ensure that the grid's DataSource or DataSourceID property is set, and call DataBind() on the grid.