We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Specifying the total record count

Thread ID:

Created:

Updated:

Platform:

Replies:

109827 Jul 5,2013 04:28 PM UTC Aug 16,2016 09:36 AM UTC ASP.NET MVC (Classic) 7
loading
Tags: Grid
Guillermo
Asked On July 5, 2013 04:28 PM UTC

Hello.

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.

Ajith R [Syncfusion]
Replied On July 8, 2013 01:11 PM UTC

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

Guillermo
Replied On July 8, 2013 02:46 PM UTC

Will it work with ActionMode.JSON? because I'm getting 0 as total count (even if 20 elements are displayed).

Guillermo
Replied On July 8, 2013 02:50 PM UTC

Nevermind, thank you for your help:

ActionResult result = balList.GridJSONActions<PX_Ballots2>(total);

That line with the EnableOnDemand() worked properly.

Ajith R [Syncfusion]
Replied On July 9, 2013 08:56 AM UTC

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


Razgovorov Mikhail
Replied On August 13, 2016 08:06 AM UTC

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.

Razgovorov Mikhail
Replied On August 13, 2016 09:06 AM UTC

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

Isuriya Rajan [Syncfusion]
Replied On August 16, 2016 09:36 AM UTC

Hi Razgovorov 
 
Thanks for the update. 
Please get back to us if you need further assistance on this. 
 
 
 
Regards, 
Isuriya R. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;