DxMenuItem.Click Event
Fires when a user clicks the menu item.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[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.
<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