Sorting Group Rows by Summary Values
When a grid's data is grouped, rows are always sorted against grouping columns. By default, group rows are sorted in the order specified by a corresponding grouping column. If a grid displays group summaries, group rows can also be sorted by their summary values.
To sort group rows by their summary values in code:
- Create a new GridGroupSummarySortInfo object.
- Specify its GridGroupSummarySortInfo.FieldName (identifies the grouping column by its field name), GridGroupSummarySortInfo.SortOrder (specifies the sort order) and GridGroupSummarySortInfo.SummaryItem (represents the summary item used to calculate summary values) properties.
- Add this object to the GridControl.GroupSummarySortInfo collection.
After this object has been added to the collection, group rows are automatically sorted by their group summary values. To cancel sorting in code, remove this object from the collection.
End-users can sort group rows by summary values using a column header's context menu. To learn more, see End-User Capabilities - Sorting Group Rows By Summary.