This is a migrated thread and some comments may be shown as answers.

server side filtering, sorting and pagination for .NEt core

5 Answers 1920 Views
Grid
This is a migrated thread and some comments may be shown as answers.
yavnika
Top achievements
Rank 1
yavnika asked on 16 Sep 2016, 04:21 AM
do you have any implementation for server side filtering , sorting and paging of the grid using .Net core?

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 19 Sep 2016, 08:02 AM
Hello Yavnika,

This depends on the used technology:

1) Kendo UI for MVC. I can suggest using the ToDataSourceResult extension method to convert the data to a Kendo.Mvc.UI.DataSourceResult object. This extension method will page, filter, sort, or group your data using the information provided by the DataSourceRequest object. :

http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/binding/ajax-binding 

2) For Kendo UI for jQuery (vanilla HTML/JS Kendo UI widgets), we do not support this functionality out of the box.

I hope this is helpful.

Regards,
Stefan
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Chris
Top achievements
Rank 1
answered on 17 Apr 2019, 11:31 PM

Don't rely on Telerik tech. support. 

I've done server side filtering, sorting and pagination.  essentially you need to add the following to your grid within the datasource component:  .ServerOperation(true).

then implement an iqueryable extension for your datamodel like so:

public static class AjaxCustomBindingExtensions
    {
        public static IQueryable<DomainModel> ApplyOrdersPaging(this IQueryable<DomainModel> data, int page, int pageSize)
        {
            if (pageSize > 0 && page > 0)
            {
                data = data.Skip((page - 1) * pageSize);
            }
 
            data = data.Take(pageSize);
 
            return data;
        }
.........
.......

etc.  Implement for sorting, and whatever else you need.  And that's it.  

 

It's normally easier to write server side code to accomplish custom filtering, 

 

 

 

0
Viktor Tachev
Telerik team
answered on 19 Apr 2019, 12:02 PM
Hello,

The online examples include a demo that illustrates how custom binding can be implemented with the components. The code shown from the snippet is available there:



Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Milind
Top achievements
Rank 1
answered on 13 Jul 2019, 09:46 AM

Hello,

I am Milind. I am working on .net core project where I have used grid. I have been looking out for server side filtering, sorting and paging for ages. I will be thankful if you could share a sample working code to achieve this. I tried to get going with the clue you have specified, but unable to make any headway.

Thanks again

 

Milind Shevade

0
Marin Bratanov
Telerik team
answered on 15 Jul 2019, 05:07 AM
Hi Milind,

Server operations are enabled by default on an AJAX data source of a grid. What is important is that you must use the appropriate action for that. You can find an example in the following demo for ASP.NET Core (its description also provides some details on client vs. server operations): https://demos.telerik.com/aspnet-core/grid/remote-data-binding. Here's how the Read action looks like in this demo:

public IActionResult Customers_Read([DataSourceRequest] DataSourceRequest request)
{
    return Json(GetCustomers().ToDataSourceResult(request));
}


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
yavnika
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Chris
Top achievements
Rank 1
Viktor Tachev
Telerik team
Milind
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or