New to Telerik UI for ASP.NET MVC? Download free 30-day trial

ToggleButton ToolBar Command Type

The ToggleButton allows users to switch between two states.

To define a ToggleButton, set the Togglable() method of the button to true. The ToggleButton supports the same configuration options as the standard Button.

Clicking a ToggleButton triggers the Toggle event but does not trigger the Click event.

The following example demonstrates how to define a ToggleButton in the ToolBar component.

    @(Html.Kendo().ToolBar()
        .Name("ToolBar")
        .Items(items =>
        {
            items.Add().Type(CommandType.Button)
                 .Togglable(true)
                 .Text("My Toggle Button")
                 .SpriteCssClass("myIcon")
                 .ShowIcon(ShowIn.Toolbar)
                 .Selected(true);
        })
    )

See Also

In this article