ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to modify pagination in grid according to database ?
Title:
B
I
{code}
?
I am implementing pagination at database side by passing PageNo and PageSize as input parameters to my stored procedures, how to modify the *getGridItems* method to pass *pageno.* and *pagesize* as parameters. Right now , when getGridItems is called at first, *g.Page = 1* and *g.PageSize = 10* is set by default, these values I am passing to my database , so I am able to get only 10 records. On View, I see only 10 records, and page no. as 1, and total records count is showing *1 - 10 of 10 items* but I want count for all records , suppose I have 50 records, so the bottom of grid should show page no. as 1,2,3,4,5 and records count as showing *1-10 of 50 records* please suggest some help ??
Save Changes
Cancel
Tanuj Shrivastava
asked at 09 Aug 2016
since you're using stored procedures you must have a look at this demo: http://demo.aspnetawesome.com/GridDemo/CustomQuerying ; you can set g.PageSize if you want a different pagesize
at 09 Aug 2016
Omu
should I use navigation buttons like >, >> to increment the page no. as I want to keep the default pagesize. And Is it possible to use them in awesome mvc grid
at 09 Aug 2016
Tanuj Shrivastava
the important thing here is that when you're using stored procedures there's no linq support so you need to use it as in the demo mentioned above; for a custom pager look here http://demo.aspnetawesome.com/CustomPagerGridDemo
at 09 Aug 2016
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK