- Home
- Forum
- ASP.NET MVC (Classic)
- Specifying the total record count
Specifying the total record count
I'm doing an example and I work with a database with 700.000 results. Obviously I don't return them all, just return the results of the current page.
My question is, as I'm doing that is only showing a total count as the total results of that page (for pagesize 20 the total result is 20).
I can't create a full list with the 700.000 elements, just want to return 20 but specify somehow that there are 700.000 so it makes the paging.
Thanks.
Hi Guillermo,
Thanks for using Syncfusion products.
Query: Specifying the total record count?
To achieve your requirement, we suggest you to use custom binding feature of grid, for specifying the total record count in essential grid. Please refer the below code snippet for further details.
Configure the grid to use custom binding with the EnableOnDemand() method.
@(Html.Syncfusion().Grid<Order>("OrdersGrid")
.Datasource(Model)
.Caption("Orders")
.EnableOnDemand()
)
If the paging feature is enabled, you need to set TotalRecordCount. This field is required to display the grid pager properly.
@(Html.Syncfusion().Grid<Order>("OrdersGrid")
.Datasource(Model)
.Caption("Orders")
.EnableOnDemand()
.TotalRecordCount(200)
)
Please refer the below link to know further details about custom binding features.
http://mvc.syncfusion.com/demos/ui/grid/DataBinding/CustomBinding
For your convenience we have attached a sample for the above scenario. Please refer the below link to download it.
Please let us know if you have any concerns.
Regards,
Ajith R
OnDemandPaging_404ea84e.zip
ActionResult result = balList.GridJSONActions<PX_Ballots2>(total);
That line with the EnableOnDemand() worked properly.
Hi Guillermo,
Thanks for your update. We are glad to know that your issue has been resolved.
Please let us know if you have any other concerns so that we will be happy to
help you out.
Regards,
Ajith R
usual in such cases is requested for a single entry is more than I show to find out there is or not.
is it possible to use a paging without total number of records (records a lot, and the total amount does not matter), the main thing is to be available to the next page without going to the end.
usual in such cases is requested for a single entry is more than I show to find out there is or not.
I understood. I made using a template
- 7 Replies
- 4 Participants
-
GU Guillermo
- Jul 5, 2013 04:28 PM UTC
- Aug 16, 2016 09:36 AM UTC