How can I fix error message "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount"
There are two approaches to fix this error:
- Set the CurrentPageIndex = 0 when you bind data in the Page_EventHandler
- Allow the error to occur and then catch it in a try block resetting the index to 0 and rebinding the grid