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

RadGrid Sorting a Date column and moving empty rows to the end

3 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
jasear
Top achievements
Rank 1
jasear asked on 24 Aug 2009, 03:20 PM
Hi,

I have a radgrid with a date column. When I sort ascending order the empy dates appear at the top. I want the ascending functionality to work in a way so that the columns with the date appear at the top in ascending order where as the empty dates are moved right to the end.

What would be the best approach to achieve this?

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 26 Aug 2009, 08:20 AM
Hi jasear,

Unfortunately, handling this behavior by default is not an option. You can cancel out the default sorting, and raise the NeedDataSource event handler, where you can pass a datasource, which is formatted as per your requirements.
I hope this suggestion helps.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Christopher
Top achievements
Rank 1
answered on 03 Jun 2010, 03:00 PM
I, too, am having an issue with sorting dates in my radgridview.  My date fields are in the following format, 03-Jun-2010, and the sorting always seems to sort by the day not the year.  I tried setting the DataType on the column to System.DateTime but it failed.  Can this be done with default sorting or do I need to create my own custom sorting?

Thanks,
Chris
0
Yavor
Telerik team
answered on 08 Jun 2010, 11:45 AM
Hello Christopher,

If the data passed from the underlying datasource is the correct one, and the control is properly bound, the sorting will order the data as expected, regardless of the format string. This is demonstrated in the sample attached to this message.

Regards,
Yavor
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
General Discussions
Asked by
jasear
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Christopher
Top achievements
Rank 1
Share this question
or