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

[Solved] forcing numerical sort on a varchar field

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John Chatt
Top achievements
Rank 1
John Chatt asked on 25 Feb 2010, 04:12 PM
I would like to sort a column by numerical and alphabetical.
for instance I have a varchar() column that contains mostly numbers and I would like it to be sorted 1,4,7,10,20 instead of 1,10,20,4,7.
I want it this way because the column contains data like "1 Bat", "1 Cat", "1 Dog", "10 Bats", "2 Cats", "5 Dogs".....

Is this possible with the RadGrid?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Feb 2010, 08:49 AM
Hi,

The column sorts based on the datatype. Since your column contains both number and string  ,a suggestion would be to perform custom sorting which will skip the default sort behavior and allow you to use a custom sort for a column.

Thanks,
Princy
Tags
Grid
Asked by
John Chatt
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or