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

Defines the fluent API for configuring ToolBarItemMenuButton

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

ToolBarItemMenuButtonBuilder method.

C#
public ToolBarItemMenuButtonBuilder(ToolBarItemMenuButton container)
Parameters:containerToolBarItemMenuButton

Properties

Gets the settings being configured.

C#
protected ToolBarItemMenuButton Container { get; }

Methods

Specifies whether the menu button is initially enabled or disabled.

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

The value for Enable

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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()
Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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

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

The value for Hidden

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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 for HtmlAttributes

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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 for HtmlAttributes

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

Sets icon for the menu buttons. 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.

C#
public ToolBarItemMenuButtonBuilder Icon(Action<ToolBarItemMenuButtonIconSettingsBuilder> configurator)
Parameters:configuratorAction<ToolBarItemMenuButtonIconSettingsBuilder>

The ToolBarItemMenuButtonIconSettingsBuilder for the icon setting.

Returns:

ToolBarItemMenuButtonBuilder

Returns the current instance of ToolBarItemMenuButtonBuilder .

Sets icon for the menu buttons. 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.

C#
public ToolBarItemMenuButtonBuilder Icon(string icon)
Parameters:iconstring

The icon.

Returns:

ToolBarItemMenuButtonBuilder

Returns the current instance of ToolBarItemMenuButtonBuilder .

Specifies the ID of the menu buttons.

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

The value for Id

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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 for ImageUrl

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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 for SpriteCssClass

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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 for Text

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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 for Url

Returns:

ToolBarItemMenuButtonBuilder

Returns the current ToolBarItemMenuButtonBuilder instance.

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