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

Defines the fluent API for configuring the ToolBarItemMenuButton settings.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ToolBarItemMenuButtonBuilder

Inheritance: objectToolBarItemMenuButtonBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public ToolBarItemMenuButtonBuilder(ToolBarItemMenuButton settings)
Parameters:settingsToolBarItemMenuButton

Methods

Specifies whether the menu button is initially enabled or disabled.

C#
public ToolBarItemMenuButtonBuilder Enable(bool value)
Parameters:valuebool

The value that configures the enable.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Enable(true));
})
)

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

C#
public ToolBarItemMenuButtonBuilder Hidden(bool value)
Parameters:valuebool

The value that configures the hidden.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =>
{
items.Add().MenuButtons(m => m.Add().Hidden(true));
})
)

Specifies the HTML attributes of a menu button.

C#
public ToolBarItemMenuButtonBuilder HtmlAttributes(IDictionary<string, object> value)
Parameters:valueIDictionary<string, object>

The value that configures the htmlattributes.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().HtmlAttributes(new Dictionary&lt;string, object&gt;
{
{ "class", "custom-button" },
{ "id", "customButtonId" },
{ "data-role", "button" }
});
})
)

Specifies the HTML attributes of a menu button.

C#
public ToolBarItemMenuButtonBuilder HtmlAttributes(object value)
Parameters:valueobject

The value that configures the htmlattributes.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().HtmlAttributes(new { @class = "custom-button", id = "customButtonId" }));
})
)

Sets icon for the menu buttons. The icon should be one of the existing in the Kendo UI theme sprite.

C#
public ToolBarItemMenuButtonBuilder Icon(string value)
Parameters:valuestring

The value that configures the icon.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().Icon("gear"));
})
)

Specifies the ID of the menu buttons.

C#
public ToolBarItemMenuButtonBuilder Id(string value)
Parameters:valuestring

The value that configures the id.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().Id("id"));
})
)

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

C#
public ToolBarItemMenuButtonBuilder ImageUrl(string value)
Parameters:valuestring

The value that configures the imageurl.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().ImageUrl("imageUrl"));
})
)

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

C#
public ToolBarItemMenuButtonBuilder SpriteCssClass(string value)
Parameters:valuestring

The value that configures the spritecssclass.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().SpriteCssClass("k-icon k-font-icon k-i-refresh"));
})
)

Specifies the text of the menu buttons.

C#
public ToolBarItemMenuButtonBuilder Text(string value)
Parameters:valuestring

The value that configures the text.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().Text("menuButtonText"));
})
)

Specifies the url of the menu button to navigate to.

C#
public ToolBarItemMenuButtonBuilder Url(string value)
Parameters:valuestring

The value that configures the url.

Returns:

ToolBarItemMenuButtonBuilder

Example:
C#
@(Html.Kendo().ToolBar()
.Name("toolBar")
.Items(items =&gt;
{
items.Add().MenuButtons(m =&gt; m.Add().Url("menuButtonUrl"));
})
)