views:

154

answers:

2

Hi

I've got a ASP.NET web page, which has a bound datagrid on it, it was having trouble with showing vertical and horizontal scroll bars when it got over 14 items in it, so I decided to move the datagrid to paging, which works fine when it first loads, it shows the first 14 items, and places the correct number of next page links at the bottom, however when I click on one of these, the page post back to itself BUT stays page one

Any clues at to what I might have missed / need to check

Thanks in advance

+1  A: 

Did you handle the page_indexchanging event:

Protected Sub gvRequests_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gvRequests.PageIndexChanging
    Me.gvRequests.PageIndex = e.NewPageIndex

    BindGrid()
End Sub

You need to handle that event and rebind your grid.

JonH
Thanks JonH it was that simple
spacemonkeys
PS ... Feel very small now :-)
spacemonkeys
+1  A: 

Check this link below, it can be many different things:

Paging in a GridView Web Server Control

rick schott
Thanks for the Link Rick, much to my embarresment JonH pointed me in the right direction
spacemonkeys
Don't be, this site is for learning, I learn something new everyday from it.
rick schott