DxToolbarBase.ItemClick Event

Fires when a user clicks a Toolbar item.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.dll

Declaration

[Parameter]
public EventCallback<ToolbarItemClickEventArgs> ItemClick { get; set; }

Event Data

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

Property Description
ItemName Specifies a clicked item's Name property value.
MouseEventArgs The Blazor's built-in MouseEventArgs event arguments.

Remarks

Use the ItemClick event to specify a common click handler that should be applied to all Toolbar items.

<DxToolbar ItemClick="@OnItemCommonClick">
    <DxToolbarItem Text="Insert"></DxToolbarItem>
    <DxToolbarItem Text="Edit"></DxToolbarItem>
    <DxToolbarItem Text="Delete"></DxToolbarItem>
</DxToolbar>

@ClickedItem

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

    void OnItemCommonClick(ToolbarItemClickEventArgs e) {
        ClickedItem = $"The '{e.ItemName}' button has been clicked";
    }
}

You can also specify individual click handlers for Toolbar items using the Click event.

See Also