ASP.NET: Paging in Grid View

Paging in ASP.NET Gridview is very simple. To enable paging in a gridview follow the below steps, 1. Go to Gridview's Propertie...


Paging in ASP.NET Gridview is very simple.

To enable paging in a gridview follow the below steps,

1. Go to Gridview's Properties and Set "Allow Paging" property to "True".
2. Specify the number of rows a single page should contain in the "PageSize" property.
3. Write the below code in the Gridview's PageIndexChanging event.

 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;

            //Code to bind datasource
            GridView1.DataBind();
        }
}

Sample GridView with Paging Enabled
















Please leave your comments and queries about this post in the comment sections in order for me to improve my writing skills and to showcase more useful posts. Thanks for reading this!!

Subscribe to GET LATEST ARTICLES!


Related

GridView 1952375533029728391

Post a Comment

  1. This blog is very useful and full of insights. Thank you!local seo agency in gwalior

    ReplyDelete
  2. One of the coolest features of 1Win is its lightning-fast withdrawals: just complete your 1Win Login and cash out winnings in minutes. No waiting, no complications. This reliability makes thousands of global players choose this gaming hub daily. When your time and wins matter, speed makes all the difference!
    Visit to know More- https://the1win.org/

    ReplyDelete

emo-but-icon

SUBSCRIBE


item