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

DxToolbar.ItemClick Event

Fires when a user clicks a Toolbar item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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
Info Returns information about a clicked item.
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.

Razor
<div class="card p-2">
    <DxToolbar Title="Operations:" ItemClick="OnItemClick">
        <DxToolbarItem Text="Insert" Name="Insert"></DxToolbarItem>
        <DxToolbarItem Text="Edit" Name="Edit"></DxToolbarItem>
        <DxToolbarItem Text="Delete" Name="Delete"></DxToolbarItem>
    </DxToolbar>
</div>

@ClickedItem

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

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

Toolbar Item Click

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

See Also