Invalid Index in paging

G

Guest

I am getting the following error when I try to go to the second page of my
datagrid:

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount

I have searched the other logs on this error and the recommendation has been
to set the currentpageindex = 0. When I do this, it does not bring back the
records in the grid that I am expecting. In fact, it brings back no records
at all. My subroutine is:


Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e
As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
DataGrid1.PageIndexChanged
'Change pages on the grid.
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataBind()
End Sub

Any sugestions on how to change my subroutine to get past this error would
be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top