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

Apply paging, sorting and filtering with server

I need to get only data of current page from web api 
and go to server with change page with parameters of sorting, filtering and new page
how to apply that using angular grid
regards, 
Omar Ramadan 

1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team April 18, 2017 02:49 AM UTC

Hi Omar, 

Thanks for contacting Syncfusion support. 
We have built-in support of web api adaptor for bound the grid data as well as perform the sorting, filtering and paging as server side. Please refer to the following Help documentation for more information, 
We have also prepared the sample based on your requirement which can be download from following link. 

In that sample, we have rendered the Grid using angular and web api adaptor. Here, we can get the filter, paging and sorting details like as follows, 
Code example
@server side 
public object Get() 
        { 
            var queryString = System.Web.HttpContext.Current.Request.QueryString; 
            int skip = Convert.ToInt32(queryString["$skip"]); 
            int take = Convert.ToInt32(queryString["$top"]);  
            List<EmployeeTable> emp = db.EmployeeTables.ToList();   
  
            //here we can perform the filter/sorting     
                 
            var data=emp.Skip(skip).Take(take).ToList();   //paging operation  
            return new { Items = data.Skip(skip).Take(take), Count = data.Count() };  
 
        } 

Screenshot for filtering
 
Screenshot for sorting
 


Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon