Back to Devexpress

ASPxGroupSummarySortInfo Class

aspnet-devexpress-dot-web-bf3a1253.md

latest3.7 KB
Original Source

ASPxGroupSummarySortInfo Class

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

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxGroupSummarySortInfo :
    CollectionItem
vb
Public Class ASPxGroupSummarySortInfo
    Inherits 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:

GroupColumnSpecifies the column that is grouped and sorted by summary values.SummaryItemSpecifies the summary item that the control uses to calculate summary values for group rows.SortOrderSpecifies the sort order of group rows.

aspx
<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>
csharp
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);
}
vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    grid.GroupSummarySortInfo.Clear()
    Dim sortInfo As ASPxGroupSummarySortInfo = New ASPxGroupSummarySortInfo()
    sortInfo.SortOrder = ColumnSortOrder.Descending
    sortInfo.SummaryItem = grid.GroupSummary("ProductName", SummaryItemType.Count)
    sortInfo.GroupColumn = "CategoryName"
    grid.GroupSummarySortInfo.AddRange(sortInfo)
End Sub

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

Inheritance

Object StateManager CollectionItem ASPxGroupSummarySortInfo

See Also

ASPxGroupSummarySortInfo Members

DevExpress.Web Namespace