Tab

ASPxSummaryItem.ShowInColumn Property

Gets or sets a value that specifies a column in which footer (for total summary) or group row/group footer (for group summary) the summary will be displayed.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

[DefaultValue("")]
public virtual string ShowInColumn { get; set; }
<DefaultValue("")>
Public Overridable Property ShowInColumn As String

Property Value

Type Default Description
String

String.Empty

A string value that identifies the data column within the ASPxGridView by its unique identifier name (WebColumnBase.Name), the name of the data source field to which it is bound (GridViewDataColumn.FieldName), or its caption (WebColumnBase.Caption).

Remarks

The ASPxGridView enables you to calculate summaries which are aggregate functions based on values of data source fields. There are two predefined summary types: total and group summaries.

The total summary calculates an aggregate function by all rows and displays the result in a column's footer. The ShowInColumn property allows you to specify the column in whose footer the total summary will be displayed.

A group summary represents a value of the aggregate function calculated over all data rows within a group. If the ShowInColumn property isn't specified, the group summaries are displayed within all group rows displayed within the ASPxGridView. If the ShowInColumn property is set to a column's name, summaries are calculated and displayed within the group rows that correspond to the specified column only when the grid is being grouped against this column. If the ShowInColumn and ASPxSummaryItem.ShowInGroupFooterColumn properties are set to different column names, then the group summary behavior is as follows: summaries are calculated when grouping the grid by the column specified via the ShowInColumn property, and summary values are displayed within group row footer cells belonging to the column defined by the ASPxSummaryItem.ShowInGroupFooterColumn property.

NOTE

The following column identifiers are used in searching for a column:

  • The Name property
  • The FieldName property
  • The Caption property

Note that it is recommended to avoid using the same values between Name, FieldName and Caption properties.

Examples

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