Click here to Skip to main content
15,918,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have some data in gridview. i want to limit the no. of rows and access the other rows by the help of pagination. i donot want nay connection to database. can anybody provide me code..
Posted

use this in GridView:

ASP.NET
<asp:GridView ID="GrdView_Name" runat="server" AllowPaging="true" PageSize="10" PagerSettings-Mode="Numeric" OnPageIndexChanging="GrdView_Name_PageIndexChanging"...........


C#
protected void GrdView_Name_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    GrdView_Name.PageIndex = e.NewPageIndex;
    // Again call Bind function of GridView
}
 
Share this answer
 
v2
Load your datagridiew with all data.
use link butttons,
like:- First Previous Next Last.

On each click of above link button, keep track of page size & accordingly make rows visible & invisible.
 
Share this answer
 
 
Share this answer
 
Comments
Siva Hyderabad 5-Feb-14 2:09am    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900