Back to Devexpress

How to: Create Total Summaries

aspnet-3760-components-grid-view-examples-how-to-create-total-summaries.md

latest892 B
Original Source

How to: Create Total Summaries

  • Sep 30, 2021

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

csharp
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);
}
vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
     Dim totalSummary As ASPxSummaryItem = New ASPxSummaryItem()
     totalSummary.FieldName = "Budget"
     totalSummary.ShowInColumn = "Budget"
     totalSummary.SummaryType = SummaryItemType.Average
     ASPxGridView1.TotalSummary.Add(totalSummary)
End Sub