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

DxMenuItem.Click Event

Fires when a user clicks the menu item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<MenuItemClickEventArgs> Click { get; set; }

#Event Data

The Click event's data class is MenuItemClickEventArgs. The following properties provide information specific to this event:

Property Description
ItemInfo Returns information about a clicked menu item. Inherited from MenuItemEventArgs.
MouseEventArgs The Blazor’s built-in MouseEventArgs event arguments.

#Remarks

Use the Click event to specify individual click handlers for menu items. You can also use the ItemClick event to specify a common click handler for all menu items.

Razor
<div class="card w-auto">
    <DxMenu Title="DevExpress">
        <Items>
            <DxMenuItem Text="Products" IconCssClass="oi oi-layers" Click="OnItemClick"/>
            <DxMenuItem Text="Support" IconCssClass="oi oi-person" />
            <DxMenuItem Text="Documentation" IconCssClass="oi oi-book" />
            <DxMenuItem Text="Demos" IconCssClass="oi oi-monitor" />
            <DxMenuItem Text="Blogs" IconCssClass="oi oi-bell" />
            <DxMenuItem Text="Search" IconCssClass="oi oi-magnifying-glass" />
        </Items>
    </DxMenu>
</div>

@Alert

@code  {
    public string Alert { get; set; } = "";

    void OnItemClick(MenuItemClickEventArgs e)
    {                
        Alert = $"The `Products` item has been clicked";
    }
}
See Also