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

MVC Kendo Grid Sorting Enum

3 Answers 279 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Heather
Top achievements
Rank 1
Heather asked on 13 Dec 2013, 04:05 PM
I have a Kendo Grid with a column bounded to a enum.  All works fine except when it comes to sorting.  The sorting is performed on the int values of the items, instead of by the text.  i.e.

public enum Test{
    Red = 1,
    Yellow = 2
    Amber = 3
}

Sorting ascending, it outputs: Red, Yellow, Amber.  Instead of Amber, Red, Yellow.
Sorting descending it outputs: Amber, Yellow, Red.  Instead of Yellow, Red, Amber.

How can I get it to sort properly based on the text strings on the left?

Thx!

Mao

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 14 Dec 2013, 09:34 AM
Hello Mao,

I am afraid that sorting ForeignKey columns by text is currently not supported out of the box and there is no simple workaround that we can suggest.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Heather
Top achievements
Rank 1
answered on 16 Dec 2013, 01:40 PM
Are there any plans to address this?  How soon if so?
0
Alexander Popov
Telerik team
answered on 16 Dec 2013, 02:00 PM
Hello again,

Implementing this functionality is not planned at this moment, however I would encourage you to submit your suggestion at KendoUI UserVoice so other members of the community can evaluate, comment on and vote for it. Most voted ideas are included in next KendoUI releases.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Heather
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Heather
Top achievements
Rank 1
Share this question
or