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

Column sorting

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
arijit
Top achievements
Rank 1
arijit asked on 23 Sep 2010, 02:10 PM

I have a autogenerated column where i am displaying values like
205 [100,55,50]
120 [50,30,40]
506 [500,3,3]

Now, i want to sort the column on the first number (numeric sort), which is apperaing before the bracket.

Please help
Arijit

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 29 Sep 2010, 11:29 AM
Hello Arijit,

You can apply a custom sort criteria as shown in the following link:
Applying custom sort criteria

Then you can build a SQL expression that extracts the numeric part from this string and cast it to INT.
SELECT CAST( LEFT(ColumnName, CHARINDEX(' ', ColumnName)) AS INT) FROM MyTable

Regards,
Daniel
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
arijit
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or