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.ItemTextTemplate Property

Specifies the text template for menu items.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public RenderFragment<IMenuItemInfo> ItemTextTemplate { get; set; }

#Property Value

Type Description
RenderFragment<IMenuItemInfo>

The template content.

#Remarks

The Menu component allows you to use templates to customize the layout and appearance of menu items and their parts.

Use the ItemTextTemplate to specify a common text template for all menu items.

Razor
<div class="card w-auto">
    <DxMenu>
        <ItemTextTemplate>
            Item @context.Text
        </ItemTextTemplate>
        <Items>
            <DxMenuItem Text="1" />
            <DxMenuItem Text="2" />
        </Items>
    </DxMenu>
</div>

Text template for all menu items

See Also