Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

How should grid paging work?

I'm working on a new project , MVC, C#, VS 2017.

1. I stepped thru the code and looks like the grids get all the rows and then page thru.

2. I think code should get , for example,10 rows. Display those for page 1. User clicks on page 2. Code should grab the next 10 rows of data and display.
But it should NOT get the entire dataset upfront.

Now, how can I do that?
1. Stored proc to bring back chunks of data
2. Get total number of rows to display at the bottom of the grid
3. When grid is displayed the first time, stored proc will return 10 rows
4. User clicks on "page 2" and now I need to get the next 10 rows. So, what do I need to pass to the stored proc?

I think the index (what page # is clicked) needs to be tracked.
ASKER CERTIFIED SOLUTION
Avatar of Mrunal
Mrunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Camillia

ASKER

Thanks, let me take a look.
Users are bringing data up to 30,000+ rows.
Do you know how sorting should work without getting ALL the data upfront first? That link would work for paging and that's great.
in most cases, sorting is applied to complete data source, means again request will be sent to server to get sorted data.
in most cases, sorting is applied to complete data source

Ah. That defeats the purpose of paging and bringing back only a small dataset.