ASPxSummaryItemCollection.Add(SummaryItemType, String) Method
Adds a new summary item with the specified settings to the collection.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v20.1.dll
NuGet Package: DevExpress.Web
Declaration
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 shows how to calculate the average budget and display 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