Skip to main content
All docs
V24.2

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

DxTreeList.ColumnHeaderCaptionTemplate Property

Specifies a common template used to display captions of all column headers in the TreeList.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

#Property Value

Type Description
RenderFragment<TreeListColumnHeaderCaptionTemplateContext>

Template content.

#Remarks

The ColumnHeaderCaptionTemplate allows you to customize captions of all column headers in the TreeList. To define a template for individual column headers, use the DxTreeListColumn.HeaderCaptionTemplate.

The ColumnHeaderCaptionTemplate accepts a TreeListColumnHeaderCaptionTemplateContext object as the context parameter. You can use parameter members to get the current Caption, and the Column or DataColumn object. You can also access the TreeList object and use its members to obtain additional information about the TreeList.

The following example shows a tooltip when a user hovers the mouse pointer over any column caption:

@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" />
    </Columns>
    <ColumnHeaderCaptionTemplate>
        <span title="Click the header to sort data by this column. Drag and drop the header to change the column's position">
            @context.Caption
        </span>
    </ColumnHeaderCaptionTemplate>
</DxTreeList>

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

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

Blazor TreeList Column Header Caption Template

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

See Also