Skip to main content

DxContextMenu.ItemTemplate Property

Specifies the template for all context menu items.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor


public RenderFragment<IContextMenuItemInfo> ItemTemplate { get; set; }

Property Value

Type Description

The template content.


The Context Menu component allows you to define templates for the layout and appearance of menu items and their elements. For more information on templates for context menu items, refer to the following section: Context Menu - Item Templates.

Use the ItemTemplate property to specify a common template for all menu items. To override a template for an individual menu item, use the DxContextMenuItem.Template property.

<div class="target-container" @oncontextmenu="((e) => ContextMenu.ShowAsync(e))" @oncontextmenu:preventDefault>
    <p class="target-caption">RIGHT-CLICK OR LONG PRESS TO SHOW THE CONTEXT MENU</p>

<DxContextMenu @ref="@ContextMenu">
        <b>@context.Text</b> is bold!
        <DxContextMenuItem Text="Home" />
        <DxContextMenuItem Text="Contacts" />
        <DxContextMenuItem Text="Calendar" />
        <DxContextMenuItem Text="About" BeginGroup="true">
                <i>@context.Text</i> is italic!

@code {
    DxContextMenu ContextMenu { get; set; }

Context Menu Items - Template

See Also