Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
4.11/5 (2 votes)
See more:
How can we load data in grid in parts. Like for ex:- i have thousands of records in table and i want to show the first 100 by default then on a button click i want to load the next 100 and so on and the cycle continues.I dont want to hit the database every time i click the button.It should be fast.Any ideas?

Any help would be appreciated..
Thanks in advance...
Posted

You should implement pagination.
My next article could help you: Advanced ASPX GridView Pagination and Data Entities[^]
 
Share this answer
 
Set GridView Properties

AllowPaging=true,
Pagesize=100

Event

OnPageIndexChanging=GridView1_PageIndexChanging;

C#
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    GridView1.PageIndex = e.NewPageIndex;
    loadgrid();
}
 
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