DxTreeList.ColumnFooterTemplate Property
Specifies a common template used to display all footer cells in the TreeList.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public RenderFragment<TreeListColumnFooterTemplateContext> ColumnFooterTemplate { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<TreeListColumnFooterTemplateContext> | Template content. |
Remarks
The ColumnFooterTemplate
allows you to specify custom content and appearance for all footer cells displayed in the TreeList. To define a template for individual footer cells, use the DxTreeListColumn.FooterTemplate.
The ColumnFooterTemplate
accepts a TreeListColumnFooterTemplateContext object as the context
parameter. You can use the parameter’s members to get the SummaryItems, and the Column or DataColumn object. You can also access the TreeList object and use its members to obtain additional information about the TreeList (for instance, information about summary items).
The following code snippet applies italic formatting to all summary values:
@inject EmployeeTaskService EmployeeTaskService
<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" />
<DxTreeListDataColumn FieldName="EmployeeName" />
<DxTreeListDataColumn FieldName="StartDate" />
<DxTreeListDataColumn FieldName="DueDate" />
<DxTreeListDataColumn FieldName="Status" Caption="Progress" DisplayFormat="p0" />
</Columns>
<TotalSummary>
<DxTreeListSummaryItem SummaryType="TreeListSummaryItemType.Count" FieldName="Name" />
<DxTreeListSummaryItem SummaryType="TreeListSummaryItemType.Min" FieldName="DueDate" ValueDisplayFormat="y" />
<DxTreeListSummaryItem SummaryType="TreeListSummaryItemType.Max" FieldName="DueDate" ValueDisplayFormat="y" />
<DxTreeListSummaryItem SummaryType="TreeListSummaryItemType.Avg" FieldName="Status" />
</TotalSummary>
<ColumnFooterTemplate>
@{
var summaryItems = context.SummaryItems;
if (summaryItems.Any()) {
foreach (var i in summaryItems) {
@context.TreeList.GetTotalSummaryLabel(i)
<text>: </text>
<i>@context.TreeList.GetTotalSummaryFormattedValue(i)</i> <br />
}
}
}
</ColumnFooterTemplate>
</DxTreeList>
@code {
List<EmployeeTask> TreeListData { get; set; }
protected override void OnInitialized() {
TreeListData = EmployeeTaskService.GenerateData();
}
}
For more information about templates in the TreeList component, refer to the following topic: Templates in Blazor TreeList.