Click here to Skip to main content
15,923,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to set different page size in grid view.
i.e. in first page only 5 record second 25 and third page need record 100

What I have tried:

ASP.NET
<asp:GridView ID="gridview" AllowPaging="true" PageSize="10" OnPageIndexChanging="gridview_PageIndexChanging" runat="server" /> 


C#
protected void gridview_PageIndexChanging(object sender, GridViewPageEventArgs e){
    FillGrid();
    gridview.PageIndex = e.NewPageIndex;
    gridview.DataBind();
}
Posted
Updated 11-Nov-16 5:41am

1 solution

 
Share this answer
 

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