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

Sorting on Custom Edit Column

2 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 06 Jun 2013, 03:23 AM
Hello,

I am having a problem sorting by the column that I enabled a custom editor for. 

I basically followed the sample at http://demos.kendoui.com/web/grid/editing-custom.html 

How would you go about sorting by the "Category" column? The column it self is an object, so I think is getting confused.

Any ideas?

Thanks!
Covo

2 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 07 Jun 2013, 10:42 AM
Hi Ricardo,


The dataSource of the Grid supports only flat data and this is why the sorting does not work for nested objects. I would suggest you the following workaround - bind the column to the text field of the object (this will fix the sorting). Then you could omit the binding of the DropDownList (because we don't want the value field to be displayed in the column) and manually set the value of the item in the change event of the DropDownList. The only downside of the approach is that the DropDownList won't have a default value. Here is JS Bin example, which demonstrates this.

I hope that this information was helpful for you.

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ricardo
Top achievements
Rank 1
answered on 07 Jun 2013, 01:05 PM
Thansk Dimiter, I will give it a try!
Tags
Grid
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Ricardo
Top achievements
Rank 1
Share this question
or