Skip to main content

BootstrapToolbar.ItemClick Event

Occurs on the server side once a toolbar item has been clicked.

Namespace: DevExpress.Web.Bootstrap

Assembly: DevExpress.Web.Bootstrap.v22.1.dll

Declaration

public event BootstrapToolbarItemEventHandler ItemClick

Event Data

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.

Remarks

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.

Example

This example demonstrates the basic functionality of the Toolbar control.

  1. Initialize a new instance of the BootstrapToolbar class.
  2. Add required toolbar items (BootstrapToolbarItem objects) to the BootstrapToolbar.Items collection.
  3. Additional members:

    • BootstrapToolbar.ItemClick occurs when an end-user clicks a toolbar button.
    • MenuItem.Name specifies a button’s name, which identifies the item in the toolbar’s Items collection.
    • MenuItem.Text specifies a button’s display text.
    • MenuItem.BeginGroup – if set to true, the button becomes the first button in a new button group.
    • BootstrapToolbarItemBase.IconCssClass specifies the CSS class of an icon displayed by a toolbar item.
    • MenuItem.NavigateUrl specifies a button’s navigation location. When this property is specified, the button is rendered as a hyperlink.

The image below shows the result:

BootstrapToolbar_Default

function onDefaultToolbarItemClick(s, e) {
    dxbsDemo.showToast("The button '" + e.item.name + "' has been clicked.");
}
See Also