one single programmer

I've started doing some independent work on the side. This has opened my eyes to somethings and I plan to write about it as time permits.

Sunday, November 19, 2006

ASP.NET 2.0 - GridView

   One thing I’m working on right now is a page that displays all the pending changes of employees and their benefits.  I’ve never used the gridview paging tools before but since the set returned could be large I ended up setting this.  However I didn’t know that if you late bind the datasource the paging events must be handled manually.  After some research I ended up doing this:

 

Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging

 

        GridView1.PageIndex = e.NewPageIndex

        GridView1.DataSource = dsChange

        GridView1.DataBind()

 

    End Sub

 

Not rocket science but it may help someone out there.

 

 

Later.