-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Data Grid - Group Summaries
To configure group summaries, populate the summary.groupItems array with summary configuration objects. Each object should specify a column that supplies data for summary calculation and a summaryType—an aggregate function that should be applied to this data.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
@(Html.DevExtreme().DataGrid<DevExtreme.MVC.Demos.Models.Order>()
.ID("gridContainer")
.DataSource(d => d.WebApi().Controller("DataGridSummaries").Key("ID"))
.ShowBorders(true)
.Selection(s => s.Mode(SelectionMode.Single))
.Pager(p => p.Visible(true))
.Columns(columns => {
columns.AddFor(m => m.OrderNumber)
.Width(130);
columns.AddFor(m => m.OrderDate);
columns.AddFor(m => m.Employee)
.GroupIndex(0);
columns.AddFor(m => m.CustomerStoreCity);
columns.AddFor(m => m.CustomerStoreState);
columns.AddFor(m => m.SaleAmount)
.Width(160)
.Alignment(HorizontalAlignment.Right)
.Format(Format.Currency);
columns.AddFor(m => m.TotalAmount)
.Alignment(HorizontalAlignment.Right)
.Format(Format.Currency);
})
.SortByGroupSummaryInfo(i => i.Add().SummaryItem("count"))
.Summary(s => s.GroupItems(items => {
items.AddFor(m => m.OrderNumber)
.SummaryType(SummaryType.Count)
.DisplayFormat("{0} orders");
items.AddFor(m => m.SaleAmount)
.SummaryType(SummaryType.Max)
.ValueFormat(Format.Currency)
.ShowInGroupFooter(false)
.AlignByColumn(true);
items.AddFor(m => m.TotalAmount)
.SummaryType(SummaryType.Max)
.ValueFormat(Format.Currency)
.ShowInGroupFooter(false)
.AlignByColumn(true);
items.AddFor(m => m.TotalAmount)
.SummaryType(SummaryType.Sum)
.ValueFormat(Format.Currency)
.ShowInGroupFooter(true)
.DisplayFormat("Total: {0}");
})
)
)
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
Position a Group Summary
Group summaries are displayed in parentheses after the group caption. You can reposition them as follows:
-
Display a summary in a column
You can align a summary to its corresponding column (see the Sale Amount and Total Amount columns). To do this, enable the alignByColumn property. If you want to align a summary to a different column, specify the showInColumn property. -
Display Summary Values within Group Footers
You can make a summary item display its values within group footers. To do this, enable the showInGroupFooter property. Summary items will appear within their corresponding columns (see the Total Amount column). If you want to display summaries in another column, specify the showInColumn property.
Format Summary Values
To format summary values, use the valueFormat property. This demo applies the "currency" format to summary values calculated against the Total Amount and Sale Amount columns. If you also want to add custom text to summary values, use the displayFormat property. This demo sets this property for summaries of "sum" and "count" types.
Sort Groups by Summary Values
This demo sorts groups by summary values (the number of orders). To do this, the code adds an object to the sortByGroupSummaryInfo array. The object specifies the summaryItem whose values are used to sort the group rows.