Tab

ASPxSummaryItem.ShowInGroupFooterColumn Property

Gets or sets the column whose group footer cells should display summary values.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

[DefaultValue("")]
public virtual string ShowInGroupFooterColumn { get; set; }

Property Value

Type Default Description
String

String.Empty

A string value that specifies the column's name (WebColumnBase.Name), field name (GridViewDataColumn.FieldName), or 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 ShowInGroupFooterColumn property is in effect for group summaries only.

A group summary represents a value of the aggregate function calculated over all data rows within a group.

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

NOTE

This is the priority when using string column identifiers in searching for a column:

  • First, the Name property match is searched for.
  • Then, the first FieldName property match is searched for.
  • Last, the first Caption property match is searched for.

ShowInGroupFooterColumn

Example

The following example illustrates how to use the ShowInGroupFooterColumn property.

Web Forms approach:

<dx:ASPxGridView ID="ASPxGridView1" runat="server" ClientInstanceName="grid" DataSourceID="AccessDataSource1"
KeyFieldName="ProductID" AutoGenerateColumns="False" Settings-ShowFooter="true" Settings-ShowGroupFooter="VisibleAlways">
    <Columns>
    ...
    </Columns>
    <GroupSummary>
        <dx:ASPxSummaryItem FieldName="UnitPrice" ShowInGroupFooterColumn="UnitPrice" SummaryType="Sum" />
    </GroupSummary>
    <TotalSummary>
        <dx:ASPxSummaryItem FieldName="UnitPrice" ShowInColumn="UnitPrice" SummaryType="Sum" />
    </TotalSummary>
</dx:ASPxGridView>

MVC approach:

var grid = Html.DevExpress().GridView(settings =>
{
    settings.Name = "GridView";
    settings.KeyFieldName = "ID";
    ...
    settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, "TestField").ShowInGroupFooterColumn = "TestField";
    settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "NumberField").ShowInGroupFooterColumn = "NumberField";
    settings.SummaryDisplayText = (s, e) =>
    {
        if (e.IsGroupSummary)
            if (e.Item.FieldName == "TestField")
                e.Text = "TestText";
    };
});
}
...
See Also