I have an datagrid populated on load of form. It works pretty well. I can go to different pages .
I have a search criteria textbox on the same form. Based on the search criteria i re-poulate my datagrid with the new result. But if i am on any other page of datagrid rather then the first page then i get the below error. How do i handle this issue?
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.
private void grdStandard_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
grdStandard.CurrentPageIndex = e.NewPageIndex;