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.
Loading
VasanthPosted Apr 20, 2010, 10:26 AM
DataGrid1.CurrentPageIndex = 0
Please mark as answer , if it helps you.