Skip to main content

DxAccordion.ItemHeaderTextTemplate Property

Specifies a header text template for all Accordion items.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public RenderFragment<IAccordionItemInfo> ItemHeaderTextTemplate { get; set; }

Property Value

Type Description
RenderFragment<IAccordionItemInfo>

A header text template.

Remarks

Use the ItemHeaderTextTemplate to customize text of all Accordion items.

The following example applies the template:

@using Accordion.Data
@inject Data.EmployeeService EmployeeService

<DxAccordion Data=@Employees>
    <DataMappings>
        <DxAccordionDataMapping Key="LastName" />
    </DataMappings>
    <ItemHeaderTextTemplate>
        @{
            var dataItem = (Employee)context.DataItem;
        }
        <div class="text-center flex-grow-1">
            @dataItem.LastName @dataItem.FirstName
        </div>
        <DxCheckBox Checked="false">On Vacation</DxCheckBox>
    </ItemHeaderTextTemplate>
    @* ... *@
</DxAccordion>

@code {
    IEnumerable<Employee> Employees;
    protected override async Task OnInitializedAsync() {
        Employees = (await EmployeeService.Load()).Skip(5).Take(9);
    }
}

Header Template

See Also