Skip to main content
All docs
V24.2

DxTreeListSummaryItem Class

A summary item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public class DxTreeListSummaryItem :
    ParameterTrackerSettingsComponent,
    ITreeListSummaryItem,
    IGridSummaryItem

Remarks

The Blazor TreeList component can calculate total summaries across all records and display them within its footer. To create summaries, declare DxTreeListSummaryItem objects in the TotalSummary template and specify the following summary item settings:

Aggregate function
Use a summary’s SummaryType property to specify an aggregate function to calculate. DevExpress Blazor TreeList supports the following predefined functions: Sum, Min, Max, Avg, and Count.
A data field that supplies values for calculations
Set the FieldName property to the name of a data field whose values are used to calculate the summary.
  • The Count function supports data fields of all types.
  • Min and Max functions support data fields whose values can be compared.
  • Avg and Sum functions require a numeric field.
A column that displays the summary
The TreeList component displays total summaries in the TreeList footer under the column that supplies values for calculations. Use the FooterColumnName property to display the summary in another column.

Note

Summary calculation is not supported when the TreeList is bound to the GridDevExtremeDataSource or loads data on demand.

The following example calculates total summaries for TreeList columns:

@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

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

Inheritance

Object
ComponentBase
DevExpress.Blazor.Internal.BranchedRenderComponent
DevExpress.Blazor.Internal.ParameterTrackerSettingsComponent
DxTreeListSummaryItem
See Also