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

Sorting on a different column

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BishMan
Top achievements
Rank 1
BishMan asked on 24 Jul 2013, 04:04 PM
Hello all,

I have a grid that I list all the folder and the size of the folder, I have java script code that transform a size of the folder accordingly.  So a folder size can be 8 MB, 1 Gig, 400 KB, etc.  Obviously, this is a text field so we can give the user the correct information and the unit we measure the size of the folder.  Sorting does not work correctly since it is text. 

Is there a way to say for this column if you are going to sort this text column using the raw size field (or specify a specific column to use for sorting).  Meaning I have a second column in my model that has the raw size as int and I would like to use for sorting this way, 8 MB will come before 1 Gig folder.

Is there a way to do this?  if so can you provide a simple example please.

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 26 Jul 2013, 09:34 AM
Hi Jay,

 
I would suggest to bind the column to the raw size of the folders and create template where to place the transformation code - that way the column will have the correct format for the user and it will be sorted based on the raw value. 

Kind Regards,
Vladimir Iliev
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
BishMan
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or