Articles → ASP .NET GRIDVIEW → Gridview paging in asp.net

Gridview paging in asp.net





Picture showing the database table with records

Click to Enlarge



<asp:GridView ID="gvTest" runat="server" DataSourceID="dsTest"></asp:GridView>
<asp:SqlDataSource ConnectionString="connection_string" ID="dsTest" SelectCommand="Select * from Member" runat="server" />












<asp:GridView ID="gvTest" runat="server" DataSourceID="dsTest" AllowPaging="true" PageSize="2" OnPageIndexChanging="gvTest_PageIndexChanging"></asp:GridView>
<asp:SqlDataSource ConnectionString="connection_string" ID="dsTest" SelectCommand="Select * from Member" runat="server" />




protected void gvTest_PageIndexChanging(object sender, GridViewPageEventArgs e) {
	gvTest.PageIndex = e.NewPageIndex;
}



Output


Picture showing the output of Gridview paging in asp.net

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, May 21, 2015

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250