Skip to main content
A newer version of this page is available. .

DxWindow.HeaderTemplate Property

Specifies the template used to display the entire header.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public RenderFragment<IPopupElementInfo> HeaderTemplate { get; set; }

Property Value

Type Description
RenderFragment<IPopupElementInfo>

The template content.

Remarks

Use the HeaderTemplate property to customize the entire header. Predefined appearance settings do not apply. In the template, you can display any UI fragment (formatted text, images, another component, and so on). The template accepts an IPopupElementInfo object as the context parameter. You can use the parameter’s CloseCallback property to implement the Close button.

<DxButton RenderStyle="ButtonRenderStyle.Secondary" 
          Click="() => WindowVisible = !WindowVisible">SHOW A WINDOW</DxButton>
<DxWindow @bind-Visible=WindowVisible
          BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet metus vel
             nisi blandit tincidunt vel efficitur purus. Nunc nec turpis tempus, accumsan orci auctor,
             imperdiet mauris. Fusce id purus magna."
          Width="max(25vw, 250px)"
          BodyCssClass="body-style">
    <HeaderTemplate>
        <div style="background-color:rgb(95,54,141); color:white; padding-left:10px; font-size:20px">
            Information
        </div>
    </HeaderTemplate>
</DxWindow>

@code {
    bool WindowVisible { get; set; } = false;
}

Blazor Window Header Template

You can also use the following properties to customize the header:

  • HeaderText - Allows you display plain text and applies all predefined appearance settings.
  • HeaderTextTemplate - Allows you to customize the header’s text and applies predefined content alignment and paddings.

The HeaderTemplate property takes priority over the HeaderText and HeaderTextTemplate properties.

For more information about Window customization, refer to the following help topic: Content and Appearance.

See Also