DxFormLayoutGroup.HeaderTemplate Property

Specifies the template used to display the group header.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll


public RenderFragment HeaderTemplate { get; set; }

Property Value

Type Description

A render fragment that declares a group header.


Use the HeaderTemplate property to customize a Form Layout group header. If you use this property, place layout items (group content) in the Items component.

The following code snippet adds a CheckBox to the Form Layout group’s header:

    <DxFormLayoutGroup ColSpanMd="6">
            <div class="float-left">
                Work Information
            <div class="float-right">
                <DxCheckBox CheckedChanged="@((bool t) => UnemployedChanged(t))" LabelPosition="LabelPosition.Left" Checked="@Unemployed">Unemployed</DxCheckBox>
            <DxFormLayoutItem Caption="Position:" ColSpanMd="12">
                <DxTextBox @bind-Text="@Position" Enabled="!Unemployed" />
            // ...

@code {
  bool Unemployed { get; set; }
  string? Position { get; set; } = "Sales Representative";
  // ...
  void UnemployedChanged(bool value)
      // ...
      Position = value ? null : Position;
      Unemployed = value;

Custom FL Group Header

HeaderTemplate has higher priority than the Caption and CaptionCssClass properties. To apply custom CSS classes to the header, use the HeaderCssClass property.

Run Demo: Form Layout - Groups

See Also