Hi,
How do I set the CurrentPageIndex after data has been data bound to the grid?My scenario is as follows;A user is on page 3, makes some modifications and hits save. We're doing a some processing,and need to reload the entire sheet.How do I automatically jump back to page 3 after the updated data is rebound to the grid? Setting the CurrentPageIndex throws an exception.Is there some kind of event I can subscribe to?
Thanks!
So, are you setting the ItemSource to the collection immediately? Or are you reloading the UserControl in which the XamWebGrid is on?
If you're just changing the ItemSource, then you should be able to set the CurrentPageIndex immediately.
Otherwise, if you're reloading the XamWebGrid Control, you can set the currentPageIndex in the loaded event of the XamWebGrid.
-SteveZ
Thanks for your reply.
I'm setting the ItemSource "directly" using data binding, and when I try to set the CurrentPageIndex, I get the following exception;
The page index 2 is invalid. The value must be between 1 and the total PageCount.
I know for a fact that there are at least 3 pages. My collection contains 56 items, and I have set the PageSize to 20.