aspnet-devexpress-dot-web-d3ca9c83.md
Represents a summary item.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public class ASPxSummaryItem :
ASPxSummaryItemBase
Public Class ASPxSummaryItem
Inherits ASPxSummaryItemBase
The following members return ASPxSummaryItem objects:
The ASPxGridView allows you to display brief information about groups of rows or individual data columns. For instance, you can display the number of records, or the maximum value, etc. This is called a summary. Summaries are represented by the ASPxSummaryItem objects.
The ASPxGridView supports two types of summaries:
For a summary item, the following two properties must be specified.
The ASPxSummaryItemBase.FieldName property specifies the name of a data source field whose values are used for summary calculation.
The ASPxSummaryItemBase.SummaryType property specifies the aggregate function type.
<dx:ASPxSummaryItem FieldName="Total" SummaryType="Sum"/>
The summary item above summarizes the ‘Total’ field values within a group and display the sum in the group row.
The ASPxSummaryItem provides the ASPxSummaryItem.ShowInColumn and ASPxSummaryItem.ShowInGroupFooterColumn properties allowing you to select where the summary is displayed.
To learn more, see Data Summaries.
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);
}
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
DevExpress.Data.Summary.ISummaryItem
Object StateManager CollectionItem ASPxSummaryItemBase ASPxSummaryItem
See Also