RadGrid multi-column sorting not working

4 posts, 0 answers
  1. JD
    JD avatar
    2 posts
    Member since:
    Dec 2010

    Posted 09 Jul 2013 Link to this post

    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
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 11 Jul 2013 Link to this post

    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.
  3. Jeff
    Jeff avatar
    2 posts
    Member since:
    Aug 2008

    Posted 28 Oct 2015 in reply to Konstantin Dikov Link to this post

    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
  4. Jeff
    Jeff avatar
    2 posts
    Member since:
    Aug 2008

    Posted 28 Oct 2015 in reply to Jeff Link to this post

    Never mind, the problem was between the keyboard and the chair... as always.
Back to Top