Thursday, January 21, 2010

Binding Grid view with datasource and handling paging option

We have two steps for binding gridview with datasource and handling paging option

Step 1:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
GridView1.DataSource = ds
GridView1.DataBind()
end sub

Step 2:
Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
GridView1.DataBind()
End Sub

No comments:

Post a Comment