Skip to main content
Tab

ASPxSummaryItemCollection.Add(SummaryItemType, String) Method

Adds a new summary item with the specified settings to the collection.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public ASPxSummaryItem Add(
    SummaryItemType summaryType,
    string fieldName
)

Parameters

Name Type Description
summaryType SummaryItemType

A SummaryItemType enumeration value that specifies the aggregate function type. This value is assigned to the ASPxSummaryItemBase.SummaryType property.

fieldName String

A String value that specifies the name of the data source field whose values are used for summary calculation. This value is assigned to the ASPxSummaryItemBase.FieldName property.

Returns

Type Description
ASPxSummaryItem

An ASPxSummaryItem object that represents the new summary item.

Example

This example calculates the average budget and displays it within the ASPxGridView’s footer.

protected void Page_Load(object sender, EventArgs e) {
     ASPxSummaryItem totalSummary = new ASPxSummaryItem();
     totalSummary.FieldName = "Budget";
     totalSummary.ShowInColumn = "Budget";
     totalSummary.SummaryType = SummaryItemType.Average;
     ASPxGridView1.TotalSummary.Add(totalSummary);
}
See Also