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

[Solved] Datetime column as string not sorting

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mary
Top achievements
Rank 1
mary asked on 03 May 2010, 07:53 PM
Formatting a datetime col as a short date string:

columns.Add(o => o.CreateDate.Date.ToString("d")).Width(50).Title("Created");

removes the sorting on that column.

Is there a way to format a datetime column without the time and still have it sort?



1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 May 2010, 07:49 AM
Hi mary,

Yes there is. Change your code to:

columns.Add(o => o.CreateDate.Date).Format("{0:d}").Width(50).Title("Created");

Regards,
Atanas Korchev
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
mary
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or