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

DxMenu.TitleTemplate Property

Specifies the template for the menu title.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public RenderFragment<object> TitleTemplate { get; set; }

#Property Value

Type Description
RenderFragment<Object>

The template content.

#Remarks

The TitleTemplate property specifies the template for the menu title. You can use the template’s context parameter to get the menu’s title. The following code snippet uses this parameter to specify the alt attribute for the image.

Razor
<div class="card w-50">
    <DxMenu Title="DevExpress Logo">
        <TitleTemplate>
            <img width="120" src="images/Logo-Monochrome.svg" alt="@context" />
        </TitleTemplate>
        <Items>
            <DxMenuItem Text="Products" />
            <DxMenuItem Text="Support" />
            <DxMenuItem Text="Documentation" />
            <DxMenuItem Text="Demos" />
        </Items>
    </DxMenu>
</div>

Title Template

Run Demo: Menu - Templates

See Also