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

RadGrid Mixed Sorting: text and number

1 Answer 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 19 Jan 2011, 12:30 PM
Is it possible to sort a column by first number then text? I have an ID column with the following data:

CE01
FE05
112
24
DE4
98

Is there any way to sort by first integer then character to give:

24
98
112
CE01
DE4
FE05

Obviously character sorting only will result in 112 being the first row, 24, then 98 etc.

Thanks,
Daniel.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 19 Jan 2011, 01:14 PM
Hi Dan,

For such scenarios RadGrid exposes the SortCommand event.

You can skip this default sort behavior and provide your own custom sort order for a column by setting the AllowCustomSorting property of the corresponding table view. With custom sorting enabled, RadGrid displays the sorting icons but does not actually sort the data. Instead, you perform the custom sorting inside the SortCommand event handler.

You may see this event in action in this online example:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/sort/defaultcs.aspx

Kind regards,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or