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. Image for the cookie policy date

Pager Optimised data


I have about 2 million records on a table , and I found when loading the MVC grid with this data , with paging enabled the amount of data on the html page is massive. as everything gets stored using JSON. Is there a way I can keep this data server side instead and use the Controller to parse paging and filtering data and manually apply that to my Entity Framework data table?

1 Reply

JK Jayaprakash Kamaraj Syncfusion Team January 27, 2017 12:24 PM UTC

Hi Le Roux, 
Thank you for contacting Syncfusion support. 
By default, Grid provides an option to handle the larger number of records using the loadOnDemand concept. This concept can be achieved using the URLAdaptor of the DataManager. Using the URLAdaptor, Grid collects the data (need for current page) from the server. To achieve this, you have to assign the DataSource of the Grid as follows.  
              .Datasource(ds => ds.URL("/Grid/DataSource").Adaptor(AdaptorType.UrlAdaptor))   
public ActionResult DataSource(DataManager dm)   
            IEnumerable DataSource = new NorthwindDataContext().OrdersViews.ToList();   
            DataResult result = new DataResult();   
            DataOperations operation = new DataOperations();   
            result.result = DataSource;   
            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting   
                result.result = operation.PerformSorting(DataSource, dm.Sorted);   
            if (dm.Where != null && dm.Where.Count > 0) //Filtering   
                result.result = operation.PerformWhereFilter(DataSource, dm.Where, dm.Where[0].Operator);   
            result.count = result.result.AsQueryable().Count();   
            if (dm.Skip > 0)   
                result.result = operation.PerformSkip(result.result, dm.Skip);   
            if (dm.Take > 0)   
                result.result = operation.PerformTake(result.result, dm.Take);   
            return Json(result, JsonRequestBehavior.AllowGet);   
Note: skip/take are the queries responsible for handling the paging action  
The response from server should be wrapped in an object with properties named result to hold the data and count to hold the total records count. To handle the server-side operations, we have Server-side APIs which has been found in the DataOperations class of Syncfusion Libraries. Refer to the following KB.  
AllowPaging API of the Grid will handle the pagination. After enabling the AllowPaging, the Grid will be show the pager. It has been used to switching between the pages. In the server-end skip/take values will be varied according to the pagination occurred in the Grid. Refer to the following Help Document.  
While using UrlAdaptor, you can handle grid operation (filtering/searching/sorting) in server side. When performing filtering, sorting, editing operations on the grid queries are passed to the server side and processed by default and returned. But, when you group a column, the query for sorting operation is passed to the server side and by default it processes and returns the processed data. The grouping operation is executed only at the client side.   
The DataManager class helps in binding the Grid queries passed to the server-side. Based on those queries   
you can perform server-side operation on the Grid data.   
The query parameters that help you perform the server-side operations are as follows.  
It is used as OData Expand query.   
When this property is set to True, the total count of records are included in the result.   
Details regarding current page are skipped.   
Used to take required records from data manager.   
Records return the sorted collection.   
It is a data source table name.   
Records return the filter collection.   
DataManager Operations:   
The query parameters are serialized by the DataManager class and the server-side operations such as sorting, filtering, paging are performed by the PerformSortingPerfomWherFilterPerformSkip and PerformTake methods.   
Please refer to the below knowledgebase document, code example and sample.   
In Grid, we have many adaptors to perform server side operations. Please refer to the below link.   


Jayaprakash K. 

Live Chat Icon For mobile
Up arrow icon