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

Column Sort Day of the Week

3 Answers 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nick Wood
Top achievements
Rank 1
Nick Wood asked on 24 Mar 2010, 11:38 PM
Hi There

I have a string column with the day names of the week, ie Monday, Tuesday, Wednesday. When I sort by that column, it needs to be in the order of the day of the week, but at the moment as its a string it sorts alphabetically.

I dont have access to change the SQL query all I can do is try to convert it in the grid.

Is there some sort of sort converter or extension that I can apply to re sort the column?

Thanks for your help

Nick

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 Mar 2010, 09:31 AM
Hi Nick Wood,

Sure , you can hook to the Sorting Event of RadGridView and perform your own sorting logic over the items in the rows as demonstrated in this online example
Regards,
Pavel Pavlov
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.
0
Nick Wood
Top achievements
Rank 1
answered on 25 Mar 2010, 10:46 AM
Hi, thanks for the help, but this does not fill in the gaps.

The example shows how to sort based on another column that exists in the grid, but what I need is a converter that converts the inputed day of the week name to an integer ie Monday = 1 and then sort based on the integer.

Nick
0
Pavel Pavlov
Telerik team
answered on 25 Mar 2010, 11:35 AM
Hi Nick Wood,

I have prepared a small sample for you - it utilizes the custom sorting approach mentioned before.
Plese find it attached.

All the best,
Pavel Pavlov
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
GridView
Asked by
Nick Wood
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Nick Wood
Top achievements
Rank 1
Share this question
or