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

Server Side sort by column value equaling specified value

1 Answer 252 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 17 Jun 2016, 01:20 PM

Hello,

 

I'm trying to implement a kendo grid with server side sorting and filtering. I want to be able to sort using the DataSourceRequest.Sort object by more than just the member type and sort direction.

 

I essentially want the equivalent of the following IEnumerable OrderBy Method

 

queryList.OrderBy(x => x.SomeMember == SomeConstantValue)

 

Is there a way to do this by using the SortDescriptor Object?

 

Any help would be appreciated

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 21 Jun 2016, 09:48 AM
Hello Nathan,

Generally, the SortDescriptor object has two base getters/setters (i.e., Member and SortDirection) as well as two methods (i.e., serialize and deserialize). You can check that in the code http://screencast.com/t/sY2r2nXV4 as well as in the Kendo UI ASP.NET MVC API - Kendo.Mvc.SortDescriptor

If you want to implement a custom grid binding I would suggest that you examine this article - http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/binding/custom-binding . You may also find fully runnable samples of custom ajax/server binding in the Kendo UI ASP.NET MVC offline demos which can be downloaded from your account.

Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Nathan
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or