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.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.
The query parameters are serialized by the DataManager class and the server-side operations such as sorting, filtering, paging are performed by the PerformSorting, PerfomWherFilter, PerformSkip 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.