Back to Devexpress

ASPxGroupSummarySortInfoCollection Class

aspnet-devexpress-dot-web-bfed613b.md

latest4.5 KB
Original Source

ASPxGroupSummarySortInfoCollection Class

A collection of ASPxGroupSummarySortInfo objects that allow you to sort group rows by summary values.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxGroupSummarySortInfoCollection :
    Collection<ASPxGroupSummarySortInfo>
vb
Public Class ASPxGroupSummarySortInfoCollection
    Inherits Collection(Of ASPxGroupSummarySortInfo)

The following members return ASPxGroupSummarySortInfoCollection objects:

LibraryRelated API Members
ASP.NET Web Forms ControlsASPxGridView.GroupSummarySortInfo
ASP.NET MVC ExtensionsGridViewSettings.GroupSummarySortInfo

Remarks

Follow the steps below to sort group rows by summary values:

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

Use the GroupSummarySortInfo property to access 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

Implements

IList

ICollection

IStateManager

DevExpress.Utils.IAssignableCollection

IList<ASPxGroupSummarySortInfo>

ICollection<ASPxGroupSummarySortInfo>

IEnumerable<ASPxGroupSummarySortInfo>

IEnumerable

Inheritance

Object StateManagedCollectionBase Collection Collection<ASPxGroupSummarySortInfo> ASPxGroupSummarySortInfoCollection

See Also

ASPxGroupSummarySortInfoCollection Members

DevExpress.Web Namespace