5 Answers, 1 is accepted
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
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,
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
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
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