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

Defines the fluent API for configuring the Kendo UI DropDownButton

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class DropDownButtonBuilder : WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<DropDownButton, DropDownButtonBuilder>DropDownButtonBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.ToComponent()WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.Expression(string)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.Name(string)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.Deferred(bool)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.HtmlAttributes(object)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.Render()WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.ToHtmlString()WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.ToClientTemplate()WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.AsModule(bool)WidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.ComponentWidgetBuilderBase<DropDownButton, DropDownButtonBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the DropDownButtonBuilder class.

C#
public DropDownButtonBuilder(DropDownButton component)
Parameters:componentDropDownButton

Methods

Indicates whether the DropDownButton should be enabled or disabled. By default, it is enabled, unless a disabled="disabled" attribute is detected.

C#
public DropDownButtonBuilder Enabled(bool value)
Parameters:valuebool

The value for Enabled

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Defines a Kendo UI font or SVG icon that is rendered after the DropDownButton text.

C#
public DropDownButtonBuilder EndIcon(string value)
Parameters:valuestring

The value for EndIcon

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Configures the client-side events.

C#
public DropDownButtonBuilder Events(Action<DropDownButtonEventBuilder> configurator)
Parameters:configuratorAction<DropDownButtonEventBuilder>

The client events action.

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Example:
C#
@(Html.Kendo().DropDownButton()
.Name("DropDownButton")
.Events(events =&gt; events
.Click("onClick")
)
)

Sets a value controlling how the color is applied.

C#
public DropDownButtonBuilder FillMode(FillMode value)
Parameters:valueFillMode

The value for FillMode

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Defines a name of an existing icon in the Kendo UI theme sprite. The icon will be applied as background image of a span element inside the DropDownButton. The span element can be added automatically by the widget, or an existing element can be used, if it has a k-icon CSS class applied. For a list of available icon names, please refer to the Icons demo.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 DropDownButtonBuilder Icon(Action<DropDownButtonIconSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownButtonIconSettingsBuilder>

The DropDownButtonIconSettingsBuilder for the icon setting.

Returns:

DropDownButtonBuilder

Returns the current instance of DropDownButtonBuilder .

Defines a name of an existing icon in the Kendo UI theme sprite. The icon will be applied as background image of a span element inside the DropDownButton. The span element can be added automatically by the widget, or an existing element can be used, if it has a k-icon CSS class applied. For a list of available icon names, please refer to the Icons demo.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 DropDownButtonBuilder Icon(string icon)
Parameters:iconstring

The icon.

Returns:

DropDownButtonBuilder

Returns the current instance of DropDownButtonBuilder .

Defines a CSS class - or multiple classes separated by spaced - which are applied to a span element inside the DropDownButton. Allows the usage of custom icons.

C#
public DropDownButtonBuilder IconClass(string value)
Parameters:valuestring

The value for IconClass

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Defines a URL, which will be used for an img element inside the DropDownButton. The URL can be relative or absolute. In case it is relative, it will be evaluated with relation to the web page URL.The img element can be added automatically by the widget, or an existing element can be used, if it has a k-image CSS class applied.

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

The value for ImageUrl

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Specifies the menu buttons of the DropDownButton.

C#
public DropDownButtonBuilder Items(Action<DropDownButtonItemFactory> configurator)
Parameters:configuratorAction<DropDownButtonItemFactory>

The DropDownButtonItemFactory for the items setting.

Returns:

DropDownButtonBuilder

Returns the current instance of DropDownButtonBuilder .

Specifies a custom template for the menu items.

C#
public DropDownButtonBuilder ItemTemplate(string value)
Parameters:valuestring

The value for ItemTemplate

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Specifies a custom template for the menu items.

C#
public DropDownButtonBuilder ItemTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the itemtemplate.

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Specifies a custom template for the menu items.

C#
public DropDownButtonBuilder ItemTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for ItemTemplate

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Specifies a custom template for the menu items.

C#
public DropDownButtonBuilder ItemTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for ItemTemplate

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Specifies a custom template for the menu items.

C#
public DropDownButtonBuilder ItemTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for ItemTemplate

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Allows localization of the strings that are used in the widget.

C#
public DropDownButtonBuilder Messages(Action<DropDownButtonMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownButtonMessagesSettingsBuilder>

The DropDownButtonMessagesSettingsBuilder for the messages setting.

Returns:

DropDownButtonBuilder

Returns the current instance of DropDownButtonBuilder .

The options that will be used for the popup initialization. For more details about the available options refer to Popup documentation.

C#
public DropDownButtonBuilder Popup(Action<DropDownButtonPopupSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownButtonPopupSettingsBuilder>

The DropDownButtonPopupSettingsBuilder for the popup setting.

Returns:

DropDownButtonBuilder

Returns the current instance of DropDownButtonBuilder .

Sets a value controlling the border radius.

C#
public DropDownButtonBuilder Rounded(Rounded value)
Parameters:valueRounded

The value for Rounded

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Configures the DropDownButton to render a down arrow that opens and closes its popup.

C#
public DropDownButtonBuilder ShowArrowButton()
Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Configures the DropDownButton to render a down arrow that opens and closes its popup.

C#
public DropDownButtonBuilder ShowArrowButton(bool value)
Parameters:valuebool

The value for ShowArrowButton

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Sets the size of the component.

C#
public DropDownButtonBuilder Size(ComponentSize value)
Parameters:valueComponentSize

The value for Size

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Defines a CSS class (or multiple classes separated by spaces), which will be used for applying a background image to a span element inside the DropDownButton. In case you want to use an icon from the Kendo UI theme sprite background image, it is easier to use the icon property.The span element can be added automatically by the widget, or an existing element can be used, if it has a k-sprite CSS class applied.

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

The value for SpriteCssClass

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.

Sets the text content of the button.

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

The value for text content.

Returns:

DropDownButtonBuilder

Returns the current instance of DropDownButtonBuilder to allow method chaining.

Example:
C#
@(Html.Kendo().DropDownButton()
.Name("dropdownbutton")
.Text("Paste")
)

Sets the color of the component according to the applied theme.

C#
public DropDownButtonBuilder ThemeColor(ThemeColor value)
Parameters:valueThemeColor

The value for ThemeColor

Returns:

DropDownButtonBuilder

Returns the current DropDownButtonBuilder instance.