Skip to main content
All docs
V24.1

DxTreeList.TotalSummary Property

Contains total summary items.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public RenderFragment TotalSummary { get; set; }

Property Value

Type Description
RenderFragment

Total summary items.

Remarks

The DxTreeList calculates total summary values across all records and displays these values in the footer. To create a total summary, declare a DxTreeListSummaryItem object in the TotalSummary template and specify SummaryType and FieldName properties.

You can set the SummaryType property to Custom and handle the CustomSummary event to create a custom summary item. The following code snippet creates predefined total summaries:

@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>
</DxTreeList>

@code {
    List<EmployeeTask> TreeListData { get; set; }

    protected override void OnInitialized() {
        TreeListData = EmployeeTaskService.GenerateData();
    }
}

TreeList - Summary

Run Demo: Total Summary

Use the following API members to modify display text strings of total summary items:

ValueDisplayFormat
Specifies the format pattern for the summary value.
DisplayText
Specifies the display text pattern for the summary item. A display text string can include static text and placeholders for summary value and column caption.
CustomizeSummaryDisplayText
Handle this event to customize display text for an individual calculated summary value. The TreeList event argument allows you to obtain information about the TreeList’s current state and add this information to a summary item’s display text.

For more information about summaries in the TreeList component, refer to the following topic: Summary in Blazor TreeList.

See Also