DxToolbarItemBase.Click Event

Fires when a user clicks the processed item.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.dll

Declaration

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

Event Data

The Click 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 Click event to specify individual click handlers for Toolbar items. You can also use the ItemClick event to specify a common click handler for all Toolbar items.

<DxToolbar ItemClick="@OnItemCommonClick">
    <DxToolbarItem Click="@OnInsertItemClick" Text="Insert"></DxToolbarItem>
    <DxToolbarItem Click="@OnEditItemClick" Text="Edit"></DxToolbarItem>
    <DxToolbarItem Click="@OnDeleteItemClick" Text="Delete"></DxToolbarItem>
</DxToolbar>

@AlertText

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

    void OnInsertItemClick(ToolbarItemClickEventArgs args) {
        ClickedItem = "Insert";
    }
    void OnEditItemClick(ToolbarItemClickEventArgs args) {
        ClickedItem = "Edit";
    }
    void OnDeleteItemClick(ToolbarItemClickEventArgs args) {
        ClickedItem = "Delete";
    }

    void OnItemCommonClick(ToolbarItemClickEventArgs e) {
         AlertText = $"The {ClickedItem} button has been clicked";
    }
}
NOTE

Online Demo: Toolbar - Overview

See Also