We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDataGrid - sorting within groups

The program I'm working on presents a list of customers in a grid, in sorted order. Because the list is getting rather large (about 2,650 customers at last count), I'd like to start grouping it as well, by the first character of the customer name.

I've given it appropriate GroupColumnDescription and SortColumnDescription definitions in my .xaml file:

            <sync:SfDataGrid.GroupColumnDescriptions>
                <sync:GroupColumnDescription ColumnName="CustomerName" Converter="{StaticResource customerListItemConverter}"  />
            </sync:SfDataGrid.GroupColumnDescriptions>
            <sync:SfDataGrid.SortColumnDescriptions>
                <sync:SortColumnDescription ColumnName="CustomerName" SortDirection="Ascending" />
            </sync:SfDataGrid.SortColumnDescriptions>

Given these definitions, I would expect to see the list of groups in sorted order, and within each group, to see the customers in that group, also in sorted order. What I get... well, that's a different matter. The order of the groupings is as expected; the order of the customers within each group is not.

For example, under "3", I would expect to see customers listed in this order:
  • 3
  • 39N
  • 3D
  • 3H
  • 3M
  • 3P
  • 3Sigma

Instead, I get this:

  • 3
  • 39N
  • 3Sigma
  • 3D
  • 3M
  • 3P
  • 3H

The Interval Grouping sample was unfortunately not helpful, as it exhibits similar behavior (it's ostensibly sorted in ascending order by shipped date, but the dates go from 1991-05-15 to 1991-05-23, then back to 1991-05-17).

Is there any way to get this to happen?


3 Replies

SP Sowndaiyan Paulpandi Syncfusion Team December 18, 2015 01:48 PM UTC

Hi Matthew,


Thanks for contacting Syncfusion Support.

We have analyzed your query. In SfDataGrid Currently we do not have the support for apply the Sorting on Grouped column. Thank you for helping us define this feature. We have consider this as a feature and we have include this feature in end of the January 2016.

Please let us know if you require further assistance on this.


Regards,

Sowndaiyan



BE Bernd November 9, 2016 11:09 AM UTC

Hello Sowndaiyan,

is sorting of groups implemented by now?

Regards
Bernd


JG Jai Ganesh S Syncfusion Team November 10, 2016 09:57 AM UTC

  
Hi Bernd, 
  
We have provided the support for apply the Sorting on Grouped column and this will be available from our 14.2 release and in our Essential Studio Volume 3 SP 1, 2016 (Version 14.3.0.52) is rolled out and is available for download under the following link. 
  
            
After installing the Essential studio, you can achieve your requirement by setting the SortGroupRecords as "True” in GroupColumnDescription like below, 
                                    
   <syncfusion:SfDataGrid.GroupColumnDescriptions> 
                <syncfusion:GroupColumnDescription ColumnName="Name" Converter="{StaticResource groupingConverter}" SortGroupRecords="True" /> 
  </syncfusion:SfDataGrid.GroupColumnDescriptions> 
 
 
 
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon