Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridColumnFooterTemplateContext Class

Stores information about a footer cell in the Grid and is passed as the context parameter to the DxGrid.ColumnFooterTemplate and DxGridColumn.FooterTemplate.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public class GridColumnFooterTemplateContext :
    GridColumnFooterTemplateContextBase

#Remarks

The DxGrid.ColumnFooterTemplate and DxGridColumn.FooterTemplate accept a GridDataColumnGroupRowTemplateContext object as the context parameter. You can use the parameter’s members to get information about the current footer cell.

The following code snippet makes all summary values bold.

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="@Data">
    <Columns>
        <DxGridDataColumn FieldName="Country" />
        <DxGridDataColumn FieldName="City" />
        <DxGridDataColumn FieldName="OrderDate" />
        <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c" Width="150px" />
        <DxGridDataColumn FieldName="Quantity" />
    </Columns>
    <TotalSummary>
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Max" FieldName="UnitPrice" />
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Min" FieldName="UnitPrice" />
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Count" FieldName="Quantity" />
    </TotalSummary>
    <ColumnFooterTemplate>
        @{
            var summaryItems = context.SummaryItems;
            if (summaryItems.Any()) {
                foreach (var i in summaryItems) {
                    @context.Grid.GetTotalSummaryLabel(i)
                    <text>: </text>
                    <b>@context.Grid.GetTotalSummaryFormattedValue(i)</b> <br/>
                }
            }
        }
    </ColumnFooterTemplate>
</DxGrid>

@code {
    object Data { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Data = Northwind.Invoices
            .ToList();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

Blazor Grid Column Footer Template

#Inheritance

Object
DevExpress.Blazor.Internal.GridTemplateContextBase
DevExpress.Blazor.Internal.GridColumnFooterTemplateContextBase
GridColumnFooterTemplateContext
See Also