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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Paging/Sorting with Server Side Data

Thread ID:





117799 Dec 16,2014 05:24 PM UTC Jul 24,2017 03:55 AM UTC ASP.NET MVC 3
Tags: Grid
Fabio Melendez
Asked On December 16, 2014 05:24 PM UTC

Here is what I am trying to accomplish

1. Have a Rest Service calls that receives a page Size, sort criteria and it returns a List of records and number of pages to be used as data for a Grid
2. The Grid will only load the data for the given page and when the user Filters/Sorts/Pages then the grid will make the call to get the next set of data

have not been able to identify a sample nor found anything in the forums to use as guidance on this type of scenario

Madhu Sudhanan P [Syncfusion]
Replied On December 17, 2014 10:26 AM UTC

Hi Fabio,


Thanks for using Syncfusion products.


Based on your requirement, we have created a simple grid sample, in which the grid  is populated with the data from Web API 2.2 OData Controller and the same can be downloaded from the below location.


Sample Location: http://www.syncfusion.com/downloads/support/directtrac/133090/MvcApplication4-700577905.zip


The below code snippet have been used in the above sample.




        .Datasource("/odata/Orders") //Restful service url



        .FilterSettings(filter => filter.FilterType(FilterType.Menu))                               


        .Columns(cols =>











In the above sample, the filtering, paging and sorting are handled by the controller itself. Please refer the below screenshots for the request and response from the web api.












Please let us know if you have any queries.



Madhu Sudhanan. P

Replied On July 20, 2017 01:13 PM UTC

Hi Madhu Sudhanan P ,

      In my case, we are dealing with millions of data, could you recommend an approach or solution for loading these million rows into a paginated grid wherein the data are lazy loaded or loaded on demand. Based on the example, you are getting all the data at once, I am thinking of using Limits for each page. Can you shed light on this? Thanks.

Thavasianand Sankaranarayanan [Syncfusion]
Replied On July 24, 2017 03:55 AM UTC

Hi Fabio,  
According to your requirement, you have try to perform server –side paging operation in Grid.  To perform serve side operations(paging, filtering, sorting) in webapi adaptor, use ODataQueryOptions. ODataQueryOptions parameter in server side controller which contains all the required parameters for performing server side operations such as paging, sorting and filtering.  
We have created a sample in Angular JS with Web API and please download from the following link.   
Find the code example:   
<div class="row">  
    <div ej-grid id="Grid" e-width="500px" e-datasource="data" e-allowgrouping="true" ------ >  
        <div e-columns>  
    angular.module("GridCtrl", ["ejangular"])  
        .controller("bodyCtrl", function ($scope) {  
        //Provide the datasource to the grid. Here the WebApiAdaptor is used.  
        $scope.data = ej.DataManager({ url: "/api/Orders", adaptor: "WebApiAdaptor" });  
        $scope.tools = ["add", "edit", "delete", "update", "cancel", "search"];  
public PageResult<OrdersView> Get(ODataQueryOptions opts)  
            List<OrdersView> ord = db.OrdersViews.ToList();  
            return new PageResult<OrdersView>(opts.ApplyTo(ord.AsQueryable()) as IEnumerable<OrdersView>,null, ord.Count);  
Thavasianand S. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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