Forum Moderators: open
The page giving me the problem has a drop down box which (on auto postback) updates a datagrid based on a Form Variable.
The problem is caused when the drop-down returns an instance of the datagrid that has paging. If I click to the next page of that datagrid, and then use the drop down to select a different instance of the datagrid that does NOT have that second page (due to less records) I get the error, which reads:
Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
How do I reset the CurrentPageIndex value on postback so that every autopostback returns the first page of that datagrid instance?