aspnetbootstrap-devexpress-dot-web-dot-bootstrap-dot-bootstraptoolbar-f138d757.md
Occurs on the server side once a toolbar item has been clicked.
Namespace : DevExpress.Web.Bootstrap
Assembly : DevExpress.Web.Bootstrap.v25.2.dll
NuGet Package : DevExpress.Web.Bootstrap
public event BootstrapToolbarItemEventHandler ItemClick
Public Event ItemClick As BootstrapToolbarItemEventHandler
The ItemClick event's data class is BootstrapToolbarItemEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Item | Gets an item object related to the event. |
Write an ItemClick event handler to perform specific actions on the server side each time an item is clicked within the toolbar control. Note that this event fires immediately after the left mouse button is released. If the button is released when the mouse pointer is not over an item, the event doesn’t fire. You can use the event parameter’s property to identify the clicked item.
This example demonstrates the basic functionality of the Toolbar control.
The image below shows the result:
function onDefaultToolbarItemClick(s, e) {
dxbsDemo.showToast("The button '" + e.item.name + "' has been clicked.");
}
<dx:BootstrapToolbar runat="server">
<Items>
<dx:BootstrapToolbarItem Name="Copy" IconCssClass="fa fa-copy" />
<dx:BootstrapToolbarItem Name="Paste" IconCssClass="fa fa-paste" />
<dx:BootstrapToolbarItem Name="Item1" Text="Item" />
<dx:BootstrapToolbarItem Name="Link" Text="Link" NavigateUrl="#DefaultToolbar" />
<dx:BootstrapToolbarItem Name="Left" BeginGroup="true" IconCssClass="fa fa-align-left" />
<dx:BootstrapToolbarItem Name="Center" IconCssClass="fa fa-align-center" />
<dx:BootstrapToolbarItem Name="Right" IconCssClass="fa fa-align-right" />
</Items>
<ClientSideEvents ItemClick="onDefaultToolbarItemClick" />
</dx:BootstrapToolbar>
See Also