# ToolBarItemButtonBuilder

## Methods

### HtmlAttributes(System.Collections.Generic.IDictionary)

Specifies the HTML attributes of a ButtonGroup's button.

#### Parameters

##### value - `System.Collections.Generic.IDictionary<String,Object>`

The value for HtmlAttributes

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").HtmlAttributes(new Dictionary<string, object>
                                                                        {
                                                                            { "class", "custom-button" },
                                                                            { "id", "customButtonId" },
                                                                            { "data-role", "button" }
                                                                        });
                })
            )
             
```

### HtmlAttributes(System.Object)

Specifies the HTML attributes of a ButtonGroup's button.

#### Parameters

##### value - `System.Object`

The value for HtmlAttributes

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

### Click(System.String)

Specifies the click event handler of the button. Applicable only for the children of a ButtonGroup.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will be evaluated.

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

### Click(System.Func)

Specifies the click event handler of the button. Applicable only for the children of a ButtonGroup.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

### Enable(System.Boolean)

Specifies whether the button is initially enabled or disabled.

#### Parameters

##### value - `System.Boolean`

The value for Enable

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").Enable(true);
                })
            )
             
```

### Group(System.String)

Assigns the button to a group. Applicable only for the children of a ButtonGroup that has togglable true.

#### Parameters

##### value - `System.String`

The value for Group

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").Group("groupName");
                })
            )
             
```

### Hidden(System.Boolean)

Determines if the button is visible or hidden. By default the buttons are visible.

#### Parameters

##### value - `System.Boolean`

The value for Hidden

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").Hidden(true);
                })
            )
             
```

### Hidden()

Determines if the button is visible or hidden. By default the buttons are visible.

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").Hidden(true);
                })
            )
             
```

### Icon(System.String)

Sets icon for the menu button. The icon should be one of the existing in the Kendo UI theme sprite.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

#### Parameters

##### icon - `System.String`

The icon.

#### RETURNS

Returns the current instance of [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) .

### Icon(System.Action)

Sets icon for the menu button. The icon should be one of the existing in the Kendo UI theme sprite.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

#### Parameters

##### configurator - System.Action<[ToolBarItemButtonIconSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttoniconsettingsbuilder)>

The configurator for the icon setting.

#### RETURNS

Returns the current instance of [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) .

### Id(System.String)

Specifies the ID of the button.

#### Parameters

##### value - `System.String`

The value for Id

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").Id("id");
                })
            )
             
```

### ImageUrl(System.String)

If set, the ToolBar will render an image with the specified URL in the button.

#### Parameters

##### value - `System.String`

The value for ImageUrl

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").ImageUrl("imageUrl");
                })
            )
             
```

### Selected(System.Boolean)

Specifies if the toggle button is initially selected. Applicable only for the children of a ButtonGroup that has togglable true.

#### Parameters

##### value - `System.Boolean`

The value for Selected

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").Selected(true);
                })
            )
             
```

### Selected()

Specifies if the toggle button is initially selected. Applicable only for the children of a ButtonGroup that has togglable true.

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").Selected(true);
                })
            )
             
```

### SpriteCssClass(System.String)

Defines a CSS class (or multiple classes separated by spaces) which will be used for button icon.

#### Parameters

##### value - `System.String`

The value for SpriteCssClass

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                    items.Add().Type(CommandType.Button).Text("Button").SpriteCssClass("k-icon k-font-icon k-i-refresh");
                })
            )
             
```

### Toggle(System.String)

Specifies the toggle event handler of the button. Applicable only for the children of a ButtonGroup.

#### Parameters

##### handler - `System.String`

The name of the JavaScript function that will be evaluated.

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

### Toggle(System.Func)

Specifies the toggle event handler of the button. Applicable only for the children of a ButtonGroup.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

### Togglable(System.Boolean)

Specifies if the button is togglable, e.g. has a selected and unselected state. Applicable only for the children of a ButtonGroup.

#### Parameters

##### value - `System.Boolean`

The value for Togglable

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                       items.Add()
                           .Type(CommandType.Button)
                           .Text("Toggle Me")
                           .Togglable(true);
                })
            )
             
```

### Text(System.String)

Specifies the text of the menu button.

#### Parameters

##### value - `System.String`

The value for Text

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                       items.Add()
                           .Type(CommandType.Button)
                           .Text("Toggle Me");
                })
            )
             
```

### Url(System.String)

Specifies the url of the button to navigate to.

#### Parameters

##### value - `System.String`

The value for Url

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                       items.Add()
                           .Type(CommandType.Button)
                           .Text("Toggle Me");
                           .Url("url");
                })
            )
             
```

### ShowText(Kendo.Mvc.UI.ShowIn)

Specifies where the text of the menu button will be displayed. Applicable only for the buttons of a ButtonGroup.

#### Parameters

##### value - [ShowIn](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/showin)

The value for ShowText

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                       items.Add()
                           .Type(CommandType.Button)
                           .Text("Toggle Me");
                           .ShowText(ShowIn.Overflow);
                })
            )
             
```

### ShowIcon(Kendo.Mvc.UI.ShowIn)

Specifies where the icon of the button will be displayed. Applicable only for the children of a ButtonGroup.

#### Parameters

##### value - [ShowIn](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/showin)

The value for ShowIcon

#### RETURNS

Returns the current [ToolBarItemButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/toolbaritembuttonbuilder) instance.

#### Example

```
 
            @(Html.Kendo().ToolBar()
                .Name("toolBar")
                .Items(items =>
                {
                       items.Add()
                           .Type(CommandType.Button)
                           .Text("Toggle Me");
                           .ShowIcon(ShowIn.Overflow);
                })
            )
             
```
