Skip to main content

GridGroupSummaryItemCollection.Add(SummaryItemType, String, GridColumn) Method

Creates a new group summary item with predefined settings and adds it to the end of the collection.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.2.dll

Declaration

[EditorBrowsable(EditorBrowsableState.Never)]
public virtual GridGroupSummaryItem Add(
    SummaryItemType summaryType,
    string fieldName,
    GridColumn showInColumn
)

Parameters

Name Type Description
summaryType SummaryItemType

A SummaryItemType enumeration value specifying the aggregation function type. This value initializes the new item’s GridSummaryItem.SummaryType property.

fieldName String

A String value specifying the name of a dataset field whose values are used for summary calculation. This value initializes the new item’s GridSummaryItem.FieldName property.

showInColumn GridColumn

A GridColumn object (or descendant) specifying the column whose footer cells should display summary values. null (Nothing in Visual Basic) to display summary values within group rows. This value initializes the created item’s GridGroupSummaryItem.ShowInGroupColumnFooter property.

Returns

Type Description
GridGroupSummaryItem

A GridGroupSummaryItem object representing the new summary item.

Remarks

If you need to add several group summary items to the collection, consider using the GridSummaryItemCollection.BeginUpdate and GridSummaryItemCollection.EndUpdate methods to prevent the collection from being updated until all required items have been added. Alternatively, you can use the GridSummaryItemCollection.AddRange method, which adds the specified summary items array.

To remove a summary item from the collection, use the GridSummaryItemCollection.Remove method.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add(SummaryItemType, String, GridColumn) method.

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.

See Also