Back to Devexpress

ASPxGridView.GroupSummarySortInfo Property

aspnet-devexpress-dot-web-dot-aspxgridview-81e1c78d.md

latest3.4 KB
Original Source

ASPxGridView.GroupSummarySortInfo Property

Allows you to access a ASPxGroupSummarySortInfoCollection object to sort group rows by summary values.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public ASPxGroupSummarySortInfoCollection GroupSummarySortInfo { get; }
vb
Public ReadOnly Property GroupSummarySortInfo As ASPxGroupSummarySortInfoCollection

Property Value

TypeDescription
ASPxGroupSummarySortInfoCollection

A collection of ASPxGroupSummarySortInfo objects.

|

Remarks

The GroupSummarySortInfo property allows you to access the collection of ASPxGroupSummarySortInfo objects.

To sort group rows by summary values, follow the steps below:

  1. Create a new ASPxGroupSummarySortInfo object.
  2. Specify its properties.
  3. Add this object to ASPxGroupSummarySortInfoCollection.

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

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

See Also

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace