Skip to main content
Tab

ASPxGroupSummarySortInfo Class

Contains methods and properties to sort group rows by summary values.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public class ASPxGroupSummarySortInfo :
    CollectionItem

Remarks

Run Demo: ASPxGridView - Sort by Summaries

To sort group rows by summary values, create a new ASPxGroupSummarySortInfo object and add it to ASPxGroupSummarySortInfoCollection. Use the GroupSummarySortInfo property to access this collection.

You can also specify the following properties of the ASPxGroupSummarySortInfo object:

GroupColumn
Specifies the column that is grouped and sorted by summary values.
SummaryItem
Specifies the summary item that the control uses to calculate summary values for group rows.
SortOrder
Specifies the sort order of group rows.
<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" KeyFieldName="ProductID">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="ProductID" VisibleIndex="0" />
        <dx:GridViewDataTextColumn FieldName="CategoryName" VisibleIndex="1" GroupIndex="0" />
        <dx:GridViewDataTextColumn FieldName="ProductName" VisibleIndex="2" />
    </Columns>
    <GroupSummary>
        <dx:ASPxSummaryItem FieldName="ProductName" SummaryType="Count" />
    </GroupSummary>
</dx:ASPxGridView>
protected void Page_Load(object sender, EventArgs e) {
    grid.GroupSummarySortInfo.Clear();
    ASPxGroupSummarySortInfo sortInfo = new ASPxGroupSummarySortInfo();
    sortInfo.SortOrder = ColumnSortOrder.Descending;
    sortInfo.SummaryItem = grid.GroupSummary["ProductName", SummaryItemType.Count];
    sortInfo.GroupColumn = "CategoryName";
    grid.GroupSummarySortInfo.AddRange(sortInfo);
}

exGroupSummarySort

Inheritance

Object
StateManager
CollectionItem
ASPxGroupSummarySortInfo
See Also