Skip to main content
A newer version of this page is available. .
Tab

ASPxGridView.GroupSummarySortInfo Property

Enables sorting group rows by their summary values.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public ASPxGroupSummarySortInfoCollection GroupSummarySortInfo { get; }

Property Value

Type Description
ASPxGroupSummarySortInfoCollection

An ASPxGroupSummarySortInfoCollection collection which contains the information required to sort group rows by summary values.

Remarks

Use the GroupSummarySortInfo property to sort groups by their summary values. This property represents a collection of ASPxGroupSummarySortInfo objects that specify the nesting level of the group rows that are to be sorted by the summary values, the sort order and summary item used to calculate the summary values for groups of rows.

To sort group rows by summary values, you should create a new ASPxGroupSummarySortInfo object with the specified settings and add it to the GroupSummarySortInfo collection.

To cancel sorting the group rows by summary values, remove the corresponding ASPxGroupSummarySortInfo object from the collection.

Example

This example shows how to sort group rows by summary values, so that countries having the maximum sales amount appear on the top of the view.

The image below shows the result:

exGroupSummarySort

using DevExpress.Data;
using DevExpress.Web.ASPxGridView;

protected void Page_Load(object sender, EventArgs e) {
    grid.GroupSummarySortInfo.Clear();

    ASPxGroupSummarySortInfo sortInfo = new ASPxGroupSummarySortInfo();
    sortInfo.SortOrder = ColumnSortOrder.Descending;
    sortInfo.SummaryItem = grid.GroupSummary["Sales", SummaryItemType.Sum];
    sortInfo.GroupColumn = "Country";

    grid.GroupSummarySortInfo.AddRange(sortInfo);
}
See Also