Kendo.Mvc.UI.Fluent.DropDownListBuilder

Defines the fluent API for configuring the Kendo UI DropDownList

Methods

Animation(System.Boolean)

Use to enable or disable animation of the popup element.

Parameters

enable System.Boolean

The boolean value.

Example (ASPX)

<%= Html.Kendo().DropDownList()
    .Name("DropDownList")
    .Animation(false) //toggle effect
%>

Animation(System.Action<Kendo.Mvc.UI.Fluent.PopupAnimationBuilder>)

Configures the animation effects of the widget.

Parameters

animationAction System.Action<Kendo.Mvc.UI.Fluent.PopupAnimationBuilder>

The action which configures the animation effects.

Example (ASPX)

<%= Html.Kendo().DropDownList()
    .Name("DropDownList")
    .Animation(animation =>
    {
        animation.Open(open =>
        {
            open.SlideIn(SlideDirection.Down);
        })
    })
%>

Items(System.Action<Kendo.Mvc.UI.Fluent.SelectListItemFactory>)

Defines the items in the DropDownList

Parameters

addAction System.Action<Kendo.Mvc.UI.Fluent.SelectListItemFactory>

The add action.

Example (ASPX)

<%= Html.Kendo().DropDownList()
    .Name("DropDownList")
    .Items(items =>
    {
        items.Add().Text("First Item");
        items.Add().Text("Second Item");
    })
%>

DataSource(System.Action<Kendo.Mvc.UI.Fluent.ReadOnlyDataSourceBuilder>)

Sets the data source configuration of the DropDownList.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.ReadOnlyDataSourceBuilder>

The lambda which configures the data source

Filter(System.String)

The filtering method used to determine the suggestions for the current value. Filtration is turned off by default. The supported filter values are startswith, endswith and contains.

Parameters

value System.String

The value for Filter

SelectedIndex(System.Int32)

Use it to set selected item index

Parameters

index System.Int32

Item index.

Example (ASPX)

<%= Html.Kendo().DropDownList()
    .Name("DropDownList")
    .SelectedIndex(0);
%>

AutoBind(System.Boolean)

Controls whether to bind the widget to the data source on initialization.

Parameters

value System.Boolean

The value for AutoBind

AutoWidth(System.Boolean)

If set to true, the widget automatically adjusts the width of the popup element and does not wrap up the item label.

Parameters

value System.Boolean

The value for AutoWidth

CascadeFrom(System.String)

Use it to set the Id of the parent DropDownList widget.Help topic showing how cascading functionality works

Parameters

value System.String

The value for CascadeFrom

CascadeFromField(System.String)

Defines the field to be used to filter the data source. If not defined the parent's dataValueField option will be used.Help topic showing how cascading functionality works

Parameters

value System.String

The value for CascadeFromField

CascadeFromParentField(System.String)

Defines the parent field to be used to retain value from. This value will be used further to filter the dataSource. If not defined the value from the parent's dataValueField will be used.

Parameters

value System.String

The value for CascadeFromParentField

DataTextField(System.String)

The field of the data item that provides the text content of the list items. The widget will filter the data source based on this field.

Parameters

value System.String

The value for DataTextField

DataValueField(System.String)

The field of the data item that provides the value of the widget.

Parameters

value System.String

The value for DataValueField

Delay(System.Double)

Specifies the delay in milliseconds before the search-text typed by the end user is cleared.

Parameters

value System.Double

The value for Delay

Enable(System.Boolean)

If set to false the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

Parameters

value System.Boolean

The value for Enable

EnforceMinLength(System.Boolean)

If set to true the widget will not show all items when the text of the search input cleared. By default the widget shows all items when the text of the search input is cleared. Works in conjunction with minLength.

Parameters

value System.Boolean

The value for EnforceMinLength

EnforceMinLength

If set to true the widget will not show all items when the text of the search input cleared. By default the widget shows all items when the text of the search input is cleared. Works in conjunction with minLength.

FixedGroupTemplate(System.String)

The template used to render the fixed header group. By default the widget displays only the value of the current group.

Parameters

value System.String

The value for FixedGroupTemplate

FixedGroupTemplateId(System.String)

The template used to render the fixed header group. By default the widget displays only the value of the current group.

Parameters

templateId System.String

The ID of the template element for FixedGroupTemplate

FooterTemplate(System.String)

The template used to render the footer template. The footer template receives the widget itself as a part of the data argument. Use the widget fields directly in the template.

Parameters

value System.String

The value for FooterTemplate

FooterTemplateId(System.String)

The template used to render the footer template. The footer template receives the widget itself as a part of the data argument. Use the widget fields directly in the template.

Parameters

templateId System.String

The ID of the template element for FooterTemplate

GroupTemplate(System.String)

The template used to render the groups. By default the widget displays only the value of the group.

Parameters

value System.String

The value for GroupTemplate

GroupTemplateId(System.String)

The template used to render the groups. By default the widget displays only the value of the group.

Parameters

templateId System.String

The ID of the template element for GroupTemplate

Height(System.Double)

The height of the suggestion popup in pixels. The default value is 200 pixels.

Parameters

value System.Double

The value for Height

IgnoreCase(System.Boolean)

If set to false case-sensitive search will be performed to find suggestions. The widget performs case-insensitive searching by default.

Parameters

value System.Boolean

The value for IgnoreCase

MinLength(System.Double)

The minimum number of characters the user must type before a filter is performed. Set to higher value than 1 if the search could match a lot of items.

Parameters

value System.Double

The value for MinLength

NoDataTemplate(System.String)

The template used to render the "no data" template, which will be displayed if no results are found or the underlying data source is empty. The noData template receives the widget itself as a part of the data argument. The template will be evaluated on every widget data bound.

Parameters

value System.String

The value for NoDataTemplate

NoDataTemplateId(System.String)

The template used to render the "no data" template, which will be displayed if no results are found or the underlying data source is empty. The noData template receives the widget itself as a part of the data argument. The template will be evaluated on every widget data bound.

Parameters

templateId System.String

The ID of the template element for NoDataTemplate

Popup(System.Action<Kendo.Mvc.UI.Fluent.DropDownListPopupSettingsBuilder>)

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

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DropDownListPopupSettingsBuilder>

The configurator for the popup setting.

OptionLabel(System.Object)

Define the text of the default empty item. If the value is an object, then the widget will use it as a valid data item. Note that the optionLabel will not be available if the widget is empty.

Parameters

value System.Object

The value for OptionLabel

OptionLabelTemplate(System.String)

The template used to render the option label.

Parameters

value System.String

The value for OptionLabelTemplate

OptionLabelTemplateId(System.String)

The template used to render the option label.

Parameters

templateId System.String

The ID of the template element for OptionLabelTemplate

HeaderTemplate(System.String)

Specifies a static HTML content, which will be rendered as a header of the popup element.

Parameters

value System.String

The value for HeaderTemplate

HeaderTemplateId(System.String)

Specifies a static HTML content, which will be rendered as a header of the popup element.

Parameters

templateId System.String

The ID of the template element for HeaderTemplate

Template(System.String)

The template used to render the items. By default the widget displays only the text of the data item (configured via dataTextField).

Parameters

value System.String

The value for Template

TemplateId(System.String)

The template used to render the items. By default the widget displays only the text of the data item (configured via dataTextField).

Parameters

templateId System.String

The ID of the template element for Template

ValueTemplate(System.String)

The valueTemplate used to render the selected value. By default the widget displays only the text of the data item (configured via dataTextField).

Parameters

value System.String

The value for ValueTemplate

ValueTemplateId(System.String)

The valueTemplate used to render the selected value. By default the widget displays only the text of the data item (configured via dataTextField).

Parameters

templateId System.String

The ID of the template element for ValueTemplate

Text(System.String)

The text of the widget used when the autoBind is set to false.

Parameters

value System.String

The value for Text

Value(System.String)

The value of the widget.

Parameters

value System.String

The value for Value

ValuePrimitive(System.Boolean)

Specifies the value binding behavior for the widget when the initial model value is null. If set to true, the View-Model field will be updated with the selected item value field. If set to false, the View-Model field will be updated with the selected item.

Parameters

value System.Boolean

The value for ValuePrimitive

ValuePrimitive

Specifies the value binding behavior for the widget when the initial model value is null. If set to true, the View-Model field will be updated with the selected item value field. If set to false, the View-Model field will be updated with the selected item.

Virtual(System.Action<Kendo.Mvc.UI.Fluent.DropDownListVirtualSettingsBuilder>)

Enables the virtualization feature of the widget. The configuration can be set on an object, which contains two properties - itemHeight and valueMapper.For detailed information, refer to the article on virtualization.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DropDownListVirtualSettingsBuilder>

The configurator for the virtual setting.

Virtual

Enables the virtualization feature of the widget. The configuration can be set on an object, which contains two properties - itemHeight and valueMapper.For detailed information, refer to the article on virtualization.

Virtual(System.Boolean)

Enables the virtualization feature of the widget. The configuration can be set on an object, which contains two properties - itemHeight and valueMapper.For detailed information, refer to the article on virtualization.

Parameters

enabled System.Boolean

Enables or disables the virtual option.

Filter(Kendo.Mvc.UI.FilterType)

The filtering method used to determine the suggestions for the current value. Filtration is turned off by default.

Parameters

value Kendo.Mvc.UI.FilterType

The value for Filter

Events(System.Action<Kendo.Mvc.UI.Fluent.DropDownListEventBuilder>)

Configures the client-side events.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DropDownListEventBuilder>

The client events action.

Example (ASPX)

@(Html.Kendo().DropDownList()
    .Name("DropDownList")
    .Events(events => events
        .Change("onChange")
    )
)