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

Paging and Sorting is not working

Hi,

I have been using the Syncfusion data grid.

The method I use is Custom Adaptor which extends the WebApiAdaptor.

The data send from response is following exactly the requirement which is Items:[{...}, {...}], Count: 830

I have set the pageSize: 5, therefore the data should be displayed 5 items in a page.

The data displayed inside the grid table is the all results instead of 5 items only. Moreover, when I change from page 1 to page 2, the data remain same which is displaying all the data instead of the 5 items.

Could you assist me on this issue?

Attachment: Dashboard_60334bd4.rar

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team November 8, 2019 06:27 AM UTC

Hi Chew,  

Greetings from Syncfusion.  

We suspect that the Grid server-end skip/take actions were not handled. So we suggest to ensure skip/take functionality in the server-end. Refer to the following code example. 

    public class OrderController : ApiController 
    { 
        // GET: api/Order 
        public object Get() 
        { 
            var queryString = System.Web.HttpContext.Current.Request.QueryString; 
            int skip = Convert.ToInt32(queryString["$skip"]);  //paging 
            int take = Convert.ToInt32(queryString["$top"]); //paging 
            return new 
            { 
                Items = data.Skip(skip).Take(take), 
                Count = data.Count() 
                //  return order; 
            }; 
        } 
 

Regards,  
Seeni Sakthi Kumar S 


Loader.
Up arrow icon