ToolBarItemMenuButtonBuilder
Methods
HtmlAttributes(System.Object)
Specifies the HTML attributes of a menu button.
Parameters
value - System.Object
The value that configures the htmlattributes.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().HtmlAttributes(new { @class = "custom-button", id = "customButtonId" }));
})
)
HtmlAttributes(System.Collections.Generic.IDictionary)
Specifies the HTML attributes of a menu button.
Parameters
value - System.Collections.Generic.IDictionary<String,Object>
The value that configures the htmlattributes.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().HtmlAttributes(new Dictionary<string, object>
{
{ "class", "custom-button" },
{ "id", "customButtonId" },
{ "data-role", "button" }
});
})
)
Enable(System.Boolean)
Specifies whether the menu button is initially enabled or disabled.
Parameters
value - System.Boolean
The value that configures the enable.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Enable(true));
})
)
Hidden(System.Boolean)
Determines if a button is visible or hidden. By default buttons are visible.
Parameters
value - System.Boolean
The value that configures the hidden.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Hidden(true));
})
)
Icon(System.String)
Sets icon for the menu buttons. The icon should be one of the existing in the Kendo UI theme sprite.
Parameters
value - System.String
The value that configures the icon.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Icon("gear"));
})
)
Id(System.String)
Specifies the ID of the menu buttons.
Parameters
value - System.String
The value that configures the id.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Id("id"));
})
)
ImageUrl(System.String)
If set, the ToolBar will render an image with the specified URL in the menu button.
Parameters
value - System.String
The value that configures the imageurl.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().ImageUrl("imageUrl"));
})
)
SpriteCssClass(System.String)
Defines a CSS class (or multiple classes separated by spaces) which will be used for menu button icon.
Parameters
value - System.String
The value that configures the spritecssclass.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().SpriteCssClass("k-icon k-font-icon k-i-refresh"));
})
)
Text(System.String)
Specifies the text of the menu buttons.
Parameters
value - System.String
The value that configures the text.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Text("menuButtonText"));
})
)
Url(System.String)
Specifies the url of the menu button to navigate to.
Parameters
value - System.String
The value that configures the url.
Example
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Url("menuButtonUrl"));
})
)