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.
Unfortunately, activation email could not send to your email. Please try again.

How to sort the groups based on records count?

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

C#

 

VB

 

Setting CustomGroupSortOrderComparer

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

C#

 

VB

 

 

Screenshot

 

Note

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

Article ID: Published Date: Last Revised Date: Platform: Control:
7565 03/15/2017 03/15/2017 Windows Forms GridGroupingControl
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.