Home SWOT Analysis How Strong U R? Articles About Us
Mahatma Gandhi Jawaharlal Nehru Bagat Singh Kamarajar Indira Gandhi

Oh Indian

In remembrance of the Independance day Aug 15, 2007

This site is dedicated to one and all who sincerely participated in freedom struggle. Let us try to fulfill their ambitions!
Skip Navigation Links

ASP.NET - Paging Provision in Grid View


It is really wonderful that the paging provision is very simple in Grid View but very much powerful as far as the visitor experience is concerned.

We need to use the following procedure to get the Paging facility to our Gridview.

  1. Choose the GridView. Press F4 to make the properties window visible. Make the AllowPaging property to True.
    Setting AllowPaging Property to True
  2. Optionally you can play with other Paging related properties.
    Setting other Pager related Settings
  3. Make sure to assign the required datasource to the Gridview property through code. If you don't know how to do this, please refere to Listing of Records in Grid View.
  4. Additionally add the following code in the PageIndexChanging event of the Gridview.
        Protected Sub gvList_PageIndexChanging(ByVal sender As Object, _
            ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) _
                        Handles gvList.PageIndexChanging
            gvList.PageIndex = e.NewPageIndex
            LoadData()
        End Sub
    
  5. Run to view the result.
Comments from Users (0)
Leave a Reply
Name (Required)  
Mail (will not be published) (required)    
Website