Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Expand]Chart Control
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Data Editing
    [Collapse]Data Shaping and Manipulation
     [Expand]Data Summaries
     [Expand]Filtering
     [Expand]Grouping
     [Collapse]Sorting
       Sorting at Runtime
       Sorting in Code
       Sort Groups by Summary Values
      Cell Merging
    [Expand]Data Formatting
    [Expand]Master-Detail Relationship
     Appearance Customization
     Adaptivity
     Save and Restore Layout
    [Expand]Templates
     Export
     Toolbars
    [Expand]ASPxGridLookup
    ASPxGridView Designer
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
   [Expand]ASPxGridView - Animated Images
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Sort Groups by Summary Values

When ASPxGridView data is grouped, data rows are always sorted against the grouped column. By default, data rows are sorted in the order specified by the grouped column's GridViewDataColumn.SortOrder property.

Group rows can also be sorted by their summary values. To do this, you should create a new DevExpress.Web.ASPxGroupSummarySortInfo object, customize its settings and add it to the grid's ASPxGridView.GroupSummarySortInfo collection. Once this object has been added to the collection, group rows are automatically sorted by their summary values. To cancel sorting, remove this object from the collection.

The ASPxGroupSummarySortInfo class provides the following properties:

  • GroupColumn - specifies the name of the data source field that is assigned to the grouped column;
  • Sort Order - specifies the sort order;
  • SummaryItem - represents the summary item used to calculate summary values.

 

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:

How would you rate this topic?​​​​​​​