Skip to main content

GridGroupSummarySortInfo Class

Represents an element in the GridGroupSummarySortInfoCollection.

Namespace: DevExpress.Xpf.Grid

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


public class GridGroupSummarySortInfo :


Group rows displayed within the grid can be sorted by their summary values (if any). Group rows are sorted by summary values based upon the information provided by GridGroupSummarySortInfo objects. The properties introduced by these objects specify the sort order, summary item used to calculate summary values for groups of rows, etc.

To sort group rows by summary values, you should create a new GridGroupSummarySortInfo object with the specified settings (group summary item, grouping column and sort order) and add it to the GridControl.GroupSummarySortInfo collection. To cancel sorting the group rows by summary values, remove the corresponding GridGroupSummarySortInfo object from the collection.

To learn more, see Sorting Group Rows by Summary Values.


This example shows how to sort group row by summary values.

View Example

using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Documents;
using DevExpress.Xpf.Grid;

namespace DXSample_SortGroupsBySummary {
    public partial class Window1 : Window {
        public Window1() {
            grid.ItemsSource = new AccountList().GetData();
        private void SortGroupsBySummary(GridColumn column) {
            GridGroupSummarySortInfo sortInfo = new GridGroupSummarySortInfo(grid.GroupSummary[0],
                column.FieldName, System.ComponentModel.ListSortDirection.Ascending);
    public class AccountList {
        public List<Account> GetData() {
            return CreateAccounts();
        private List<Account> CreateAccounts() {
            List<Account> list = new List<Account>();
            list.Add(new Account() { UserName = "Nick White", 
                RegistrationDate = DateTime.Today, Age = 57 });
            list.Add(new Account() { UserName = "Jack Rodman",
                RegistrationDate = new DateTime(2009, 5, 10), Age = 24 });
            list.Add(new Account() { UserName = "Sandra Sherry",
                RegistrationDate = new DateTime(2009, 5, 10), Age = 35 });
            list.Add(new Account() { UserName = "Sabrina Vilk",
                RegistrationDate = DateTime.Today, Age = 19 });
            list.Add(new Account() { UserName = "Mike Pearson",
                RegistrationDate = new DateTime(2008, 10, 18), Age = 42 });
            return list;
    public class Account {
        public string UserName { get; set; }
        public DateTime RegistrationDate { get; set; }
        public int Age { get; set; }


See Also