Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridGroupSummarySortInfo Class

Represents an element in the GridGroupSummarySortInfoCollection.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public class GridGroupSummarySortInfo :
    IDetailElement<GridGroupSummarySortInfo>

#Remarks

To sort group rows by summary values:

  1. Create a GridGroupSummarySortInfo object.
  2. Specify its settings (group summary item, grouping column’s field name and sort order).
  3. Add this object to the GridControl.GroupSummarySortInfo collection.

This example demonstrates how to sort group rows by summary values in code:

Grid - Sort by Summary in Code

View Example: Sort Group Rows by Summary Values

public partial class Window1 : Window {
    public Window1() {
        InitializeComponent();
        grid.ItemsSource = AccountList.GetData();
        SortGroupsBySummary(view.GroupedColumns[0]);
    }
    void SortGroupsBySummary(GridColumn column) {
        GridGroupSummarySortInfo sortInfo = new GridGroupSummarySortInfo(grid.GroupSummary[0],
            column.FieldName, System.ComponentModel.ListSortDirection.Ascending);
        grid.GroupSummarySortInfo.Add(sortInfo);
    }
}
<dxg:GridControl x:Name="grid">
    <dxg:GridColumn FieldName="UserName"/>
    <dxg:GridColumn FieldName="RegistrationDate" GroupIndex="0"/>
    <dxg:GridColumn FieldName="Age"/>
    <dxg:GridControl.View>
        <dxg:TableView x:Name="view" AutoWidth="True"/>
    </dxg:GridControl.View>
    <dxg:GridControl.GroupSummary>
        <dxg:GridSummaryItem FieldName="Age" SummaryType="Max"/>
    </dxg:GridControl.GroupSummary>
</dxg:GridControl>

Remove the GridGroupSummarySortInfo object from the GroupSummarySortInfo collection to clear the summary sorting.

Refer to the following help topic for more information: Sorting Group Rows by Summary Values.

#Inheritance

Object
GridGroupSummarySortInfo
See Also