Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Data Binding
   [Expand]Views
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Sorting
   [Expand]Filter and Search
   [Collapse]Summaries
     Working with Summaries in Code
   [Expand]Focus and Selection Handling
    Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
    Scrolling
   [Expand]Batch Modifications
   [Expand]Hit Information
    Hints
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[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

Summaries

Summaries are grid items that utilize aggregate functions to display summary information about displayed data: total record count, minimum values, etc.

Expanded Summary Types

Total summaries (GridSummaryItem) are calculated over all Data Grid records and displayed within a view footer, which appears when the GridOptionsView.ShowFooter setting is enabled. Group summaries (GridGroupSummaryItem) are calculated over individual groups and displayed either in a group footer area or within group rows.

Expanded Total Summaries

When the view footer is visible, end-users can right-click it and use a context menu to add and remove summary items. It is also possible to right-click existing summaries to change their aggregate functions.

Related API

At design time, modify the column GridColumn.SummaryItem property to add a single summary item for this column.

If you need more than one summary, click the ellipsis button against the GridColumn.Summary property in Visual Studio's Property Grid and use the Collection Editor dialog to create summary items.

Refer to the Working with Summaries in Code article to learn how to add total summaries in code.

Demos: Data Summaries and Aggregates | Create total and group summaries | Manual total summary

Expanded Group Summaries

End-users can manually add and modify group summaries in two cases:

  • when the GridOptionsMenu.ShowGroupSummaryEditorItem is enabled. In this case, users can right-click a grouped column header to invoke a Group Summary Editor dialog.

  • when the group footer is visible (either it already has a group summary item, or the GridOptionsView.GroupFooterShowMode property is set to VisibleAlways). End-users can right-click this footer below the required column and select a summary item type.

At design-time, invoke the Data Grid designer and switch to the "Main | Group Summary Items" tab. Use this designer page to add summary items and set up their properties. GridGroupSummaryItem objects provide the same settings as total summaries, plus one additional setting: the GridGroupSummaryItem.ShowInGroupColumnFooter property allows you to choose whether an item should be displayed in a group row or group footer.

If the GridOptionsBehavior.AlignGroupSummaryInGroupRow property is enabled, all summary items shown in group footers move to group rows below corresponding column headers.

See the Working with Summaries in Code article to learn how to add group summaries in code.

Demos: Data Summaries and Aggregates | Create total and group summaries | Align group summaries in group rows

Expanded Sort Groups by Summary Values

When the Data Grid displays group summaries, end-users can right-click a column header in a group panel and select "Sort by Summary". By doing so, users can sort groups by any group summary item, associated with any Data Grid column. When sorting by summaries is active, a dash is painted above the regular ascending/descending sort indicator in column headers.

To disable the "Sort by Summary" menu item, set the GridOptionsMenu.ShowGroupSortSummaryItems property to false.

In code, add GroupSummarySortInfo objects into the GridView.GroupSummarySortInfo collection.

Demo: Sorting by Summary Values

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