Back to Devexpress

ASPxSummaryItem.ShowInGroupFooterColumn Property

aspnet-devexpress-dot-web-dot-aspxsummaryitem-418964fb.md

latest5.3 KB
Original Source

ASPxSummaryItem.ShowInGroupFooterColumn Property

Specifies a column to display group summaries in its group footer cells.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDefaultDescription
StringString.Empty

A column’s name, field name, or caption.

|

Remarks

This property is in effect for group summaries.

The grid implements the following properties that allow you to specify where to display a group summary:

ShowInColumnThe grid displays group summaries in group rows only when a user groups grid data by the column specified in this property.ShowInGroupFooterColumnThe grid displays group summaries in the specified column’s group footer cells instead of group rows.

Example

The example below assigns the “Total” column’s caption (“Total Cost”) to the ShowInGroupFooterColumn property to display group summaries in this column’s group footer cells.

Web Forms

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" ...>
    <Settings ShowGroupFooter="VisibleAlways" />
    <Columns>
        <!--...-->
        <dx:GridViewDataTextColumn FieldName="Total" UnboundType="Decimal" Caption="Total Cost" />
    </Columns>
    <GroupSummary>
        <dx:ASPxSummaryItem FieldName="Total" ShowInGroupFooterColumn="Total Cost" SummaryType="Sum" />
    </GroupSummary>
</dx:ASPxGridView>

MVC

cshtml
var grid = Html.DevExpress().GridView(settings =>
{
    settings.Name = "GridView";
    //...
    settings.Columns.Add(c =>
    {
        c.FieldName = "Total";
        c.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
        c.Caption = "Total Cost";
    });
    settings.Settings.ShowGroupFooter = GridViewGroupFooterMode.VisibleAlways;
    settings.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "Total").ShowInGroupFooterColumn = "Total Cost";
});

Run Demo: Group Footer Summaries

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowInGroupFooterColumn property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-extend-the-application-model/CS/ExtendModel.Module.Web/Controllers/WebGroupFooterViewController.cs#L26

csharp
if (currentItem.FieldName == fieldName) {
    currentItem.ShowInGroupFooterColumn = modelColumn.Caption.ToUpper();
    summaryItem = currentItem;

xaf-how-to-extend-the-application-model/VB/ExtendModel.Module.Web/Controllers/WebGroupFooterViewController.vb#L27

vb
If currentItem.FieldName = fieldName Then
    currentItem.ShowInGroupFooterColumn = modelColumn.Caption.ToUpper()
    summaryItem = currentItem

See Also

ShowInColumn

Grid Data Summaries

Group Summary

Grid View

ASPxSummaryItem Class

ASPxSummaryItem Members

DevExpress.Web Namespace