Telerik

Using server filtering is rather easy with Kendo UI MVC, unless your new to it. Then that first couple hours is pretty frustrating untill you find the right article, information and samples. I have very few gripes with Telerik and Kendo UI but they do have a problem with the Kendo UI Demos. They do not include enough sample code from controllers and web services. So hopefully this will help out those newbies to KendoUI.

When would I use this?

Server-side Filtering, Paging, and Sorting with the Grid or ListView.

How to use it?

When would I use this? Server-side Filtering with the Grid or ListView.

First thing you want to do is add the following the following using statement to you Controller or API Controller:

using Kendo.Mvc.Extensions;

Now, you can easily take advantage of ToDataSourceResult extension method to convert any IQueryable or IEnumerable to a DataSourceResult object. It will help you page, filter, sort or group your data using the information provided by the DataSourceRequestObject.

Now in the method, you just call ToDataSourceResult on your IQueryable or IEnumerator. Pretty simple, although you have to be careful when dealing with large volumes of data o make sure your implementation does not return all the data before applying filter, sorting, and paging.

How is ToDataSourceResult being implemented under the hood by Telerik? C# Extension Methods. If you need a refresher, check it out here: