GridColumnSummaryItem Class
A column’s total summary item.
Namespace: DevExpress.XtraGrid
Assembly: DevExpress.XtraGrid.v17.2.dll
Declaration
[TypeConverter(typeof(UniversalTypeConverter))]
public class GridColumnSummaryItem :
GridSummaryItem
Related API Members
The following members accept/return GridColumnSummaryItem objects:
Remarks
You can display multiple total summaries within a column’s footer. To add summaries for a column, use the GridColumn.Summary collection. This collection’s elements are GridColumnSummaryItem objects.
The GridColumnSummaryItem objects have the following properties:
- GridSummaryItem.FieldName specifies a summary’s field name.
- GridSummaryItem.SummaryType specifies a summary’s type. For example, Sum, Min, Max, Count, Custom etc.
- GridSummaryItem.DisplayFormat specifies a summary’s display format.
- GridSummaryItem.Tag allows you to associate data with the summary item.
The image below shows total summaries in a column’s footer.
Example
The example demonstrates how to add a total summary and set its summary type, field name and display format. Note that a summary is added for the Units In Stock column and it will be shown in this column. However, the summary will be calculated against a Unit Price field name.
GridColumnSummaryItem item = colUnitsInStock1.Summary.Add();
item.SummaryType = DevExpress.Data.SummaryItemType.Average;
item.FieldName = "UnitPrice";
item.DisplayFormat = "Average Unit Price = {0:c2}";
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the GridColumnSummaryItem class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.