1
Reply

Error in Datagrid Page Index changed.

ajay raju

ajay raju

Apr 17 2010 9:08 AM
5.8k

hi!
i am using datagrid to display data and i provide Pageing to the datagrid and i write code like
Protected
Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles DataGrid1.PageIndexChanged
DataGrid1.CurrentPageIndex = e.NewPageIndex
BindGrid()

End Sub
when i click next i shown next Records and also previous Records. i give pagesize = 10.
my problem is when i delete all records off 2nd page (or) 3rd page it shows error i.e.,
"Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount."
Please give code to solve this error. Please urgent sir.
Thanks.
 

Answers (1)