Skip to main content

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

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

C#
[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