Skip to main content
All docs
V24.2

DxTreeListSummaryItem.FieldName Property

Specifies a data field whose values are used to calculate a summary.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
[Parameter]
public string FieldName { get; set; }

Property Value

Type Default Description
String null

The field name.

Remarks

The Blazor TreeList component can calculate predefined and custom total summaries. Use the summary item’s SummaryType property to specify an aggregate function to calculate summary values. The following predefined functions are available: Sum, Min, Max, Avg, and Count.

Set the FieldName property to the name of a data field whose values are used to calculate the summary.

  • 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.

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

Run Demo: TreeList - Total Summary

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

Implements

See Also