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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to sort the groups based on records count?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: March 15, 2017 |
Last Revised Date: March 15, 2017

To sort the grouped items by its record count, CustomGroupSortOrderComparer class which is derived from IGroupSortOrderComparer interface can be created and customize the Compare method of custom comparer.

Code Snippet

Creating CustomGroupSortOrderComparer





Setting CustomGroupSortOrderComparer

CustomGroupSortOrderComparer has to be set to GroupSortOrderComparer property of SortColumnDescriptor that you want to sort.









If you want to sort the all other columns, the custom comparer has to be set for all other column’s SortColumnDescriptor as like above.

Sample Link

C#: CustomGroupSorting_CS

VB: CustomGroupSorting_VB

You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon