Back to Devexpress

ASPxSummaryItem Class

aspnet-devexpress-dot-web-d3ca9c83.md

latest4.8 KB
Original Source

ASPxSummaryItem Class

Represents a summary item.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxSummaryItem :
    ASPxSummaryItemBase
vb
Public Class ASPxSummaryItem
    Inherits ASPxSummaryItemBase

The following members return ASPxSummaryItem objects:

Remarks

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.

aspx
<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.

Example

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

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

DevExpress.Data.Summary.ISummaryItem

Inheritance

Object StateManager CollectionItem ASPxSummaryItemBase ASPxSummaryItem

See Also

ASPxSummaryItem Members

Grid Data Summaries

Total Summary

Group Summary

Grid View

DevExpress.Web Namespace