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

RadGrid multi-column sorting not working

3 Answers 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JD
Top achievements
Rank 1
JD asked on 09 Jul 2013, 04:15 PM
I have a RadGrid (Version 2013.2.611.45) in a .Net 4.5 project with several columns: string, numeric and date types. I am using NeedDataSource, SqlDataSource and custom sorting exactly like in the demo (http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/sorting/defaultcs.aspx). 

When I try to apply multi-column sorting: SortCommand fires just fine, the SortExpressions are properly set, but ONLY the fist selected column to sort is being sorted, even though the subsequent selected columns change their background color and their indicator arrow change as well.

Could someone advice?

Thanks,
JD

3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 11 Jul 2013, 12:55 PM
Hi JD,

Thank you for contacting us.

When you are using Custom Sorting approach for sorting your grid, RadGrid displays the sorting icons but does not actually sort the data. Instead, you must perform the custom sorting inside the SortCommand event handler.

In our demo we are sorting the grid depending on which column has been clicked. For MultiColumn custom sorting you may use RadGrid1.MasterTableView.SortExpressions (RadGrid1 being the ID of the RadGrid) where information about current sorting expressions is stored. Then you may proceed with your custom sorting logic depending on the current sorting state of every column in the grid.

If you have any further question, please feel free to contact us again. 

Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jeff
Top achievements
Rank 1
answered on 28 Oct 2015, 03:32 PM

I too am having the same problem with the new feature. have not applied any customer sorting. I only added this tag MasterTableView-AllowMultiColumnSorting="true" to the grid property. The first column sorts and the second column does not but the arrow on the header appears to make it look as if it sorted. Am I missing something?

Much Thx

Jeff
0
Jeff
Top achievements
Rank 1
answered on 28 Oct 2015, 03:45 PM
Never mind, the problem was between the keyboard and the chair... as always.
Tags
Grid
Asked by
JD
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or