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

Defines the fluent interface for configuring the DropDownList, ComboBox and MultiSelect components.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TDropDown

TDropDownBuilder

Syntax:

C#
public class ListBuilderBase<TDropDown, TDropDownBuilder> : WidgetBuilderBase<TDropDown, TDropDownBuilder>, IHtmlString where TDropDown : ListBase where TDropDownBuilder : WidgetBuilderBase<TDropDown, TDropDownBuilder>

Inheritance: objectWidgetBuilderBase<TDropDown, TDropDownBuilder>ListBuilderBase<TDropDown, TDropDownBuilder>

Derived Classes: DropDownListBuilderBase<TDropDown, TDropDownBuilder>MultiSelectBuilder

Implements: IHtmlString

Inherited Members WidgetBuilderBase<TDropDown, TDropDownBuilder>.ToComponent()WidgetBuilderBase<TDropDown, TDropDownBuilder>.Name(string)WidgetBuilderBase<TDropDown, TDropDownBuilder>.Deferred(bool)WidgetBuilderBase<TDropDown, TDropDownBuilder>.ModelMetadata(ModelMetadata)WidgetBuilderBase<TDropDown, TDropDownBuilder>.HtmlAttributes(object)WidgetBuilderBase<TDropDown, TDropDownBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<TDropDown, TDropDownBuilder>.AsModule(bool)WidgetBuilderBase<TDropDown, TDropDownBuilder>.Render()WidgetBuilderBase<TDropDown, TDropDownBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<TDropDown, TDropDownBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<TDropDown, TDropDownBuilder>.ToHtmlString()WidgetBuilderBase<TDropDown, TDropDownBuilder>.ToClientTemplate()WidgetBuilderBase<TDropDown, TDropDownBuilder>.ToString()WidgetBuilderBase<TDropDown, TDropDownBuilder>.Componentobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public ListBuilderBase(TDropDown component)
Parameters:componentTDropDown

Methods

Specifies the adaptive rendering of the component.

C#
public TDropDownBuilder AdaptiveMode(AdaptiveMode value)
Parameters:valueAdaptiveMode

The value for AdaptiveMode.

Returns:

TDropDownBuilder

Allows customization of the subtitle's text in the adaptive view of the component.

C#
public TDropDownBuilder AdaptiveSubtitle(string value)
Parameters:valuestring

The value that configures the adaptivesubtitle.

Returns:

TDropDownBuilder

Allows customization of the title's text in the adaptive view of the component.

C#
public TDropDownBuilder AdaptiveTitle(string value)
Parameters:valuestring

The value that configures the adaptivetitle.

Returns:

TDropDownBuilder

Configures the animation effects of the widget.

C#
public TDropDownBuilder Animation(Action<PopupAnimationBuilder> animationAction)
Parameters:animationActionAction<PopupAnimationBuilder>

The action which configures the animation effects.

Returns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.Animation(animation =&gt;
{
animation.Open(open =&gt;
{
open.SlideIn(SlideDirection.Down);
});
})
)

Use to enable or disable animation of the popup element.

C#
public TDropDownBuilder Animation(bool enable)
Parameters:enablebool

The boolean value.

Returns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.Animation(false) //toggle effect
)

Binds the widget to an IEnumerable list.

C#
public TDropDownBuilder BindTo(IEnumerable data)
Parameters:dataIEnumerable

The data source.

Returns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.DataTextField("CompanyName")
.DataValueField("CompanyID")
.BindTo(new List&lt;Company&gt;
{
new Company {
CompanyName = "Text1",
CompanyID = "Value1"
},
new Company {
CompanyName = "Text2",
CompanyID = "Value2"
} })
)

Configures the DataSource options.

C#
public TDropDownBuilder DataSource(Action<ReadOnlyDataSourceBuilder> configurator)
Parameters:configuratorAction<ReadOnlyDataSourceBuilder>

The DataSource configurator action.

Returns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.DataSource(source =&gt;
{
source.Read(read =&gt;
{
read.Action("GetProducts", "Home");
});
})
)

Sets the id of the external data source for the widget.

C#
public TDropDownBuilder DataSource(string dataSourceId)
Parameters:dataSourceIdstringReturns:

TDropDownBuilder

Sets the field of the data item that provides the text content of the list items.

C#
public TDropDownBuilder DataTextField(string field)
Parameters:fieldstringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.DataTextField("Text")
)

Specifies the delay in ms after which the widget will start filtering the dataSource.

C#
public TDropDownBuilder Delay(int delay)
Parameters:delayintReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.Delay(300)
)

Enables or disables the combobox.

C#
public TDropDownBuilder Enable(bool value)
Parameters:valueboolReturns:

TDropDownBuilder

Fixed group template which will be rendered as a static group header of the popup element.

C#
public TDropDownBuilder FixedGroupTemplate(string fixedGroupTemplate)
Parameters:fixedGroupTemplatestringReturns:

TDropDownBuilder

The fixed group template which will be rendered as a static group header of the popup element.

C#
public TDropDownBuilder FixedGroupTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the fixed group template.

Returns:

TDropDownBuilder

The JavaScript handler that returns the fixed group template which will be rendered as a static group header of the popup element.

C#
public TDropDownBuilder FixedGroupTemplateHandler(string value)
Parameters:valuestringReturns:

TDropDownBuilder

FixedGroupTemplateId to be used for rendering the static header of the popup element.

C#
public TDropDownBuilder FixedGroupTemplateId(string fixedGroupTemplateId)
Parameters:fixedGroupTemplateIdstringReturns:

TDropDownBuilder

FixedGroupTemplateView to be used for rendering the static header of the popup element.

C#
public TDropDownBuilder FixedGroupTemplateView(MvcHtmlString fixedGroupTemplateView)
Parameters:fixedGroupTemplateViewMvcHtmlStringReturns:

TDropDownBuilder

Footer template which will be rendered as a static footer of the popup element.

C#
public TDropDownBuilder FooterTemplate(string footerTemplate)
Parameters:footerTemplatestringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.FooterTemplate("Total #: instance.dataSource.total() # items found")
)

Footer template which will be rendered as a static footer of the popup element.

C#
public TDropDownBuilder FooterTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the fixed group template.

Returns:

TDropDownBuilder

The JavaScript function that returns the Footer template which will be rendered as a static footer of the popup element.

C#
public TDropDownBuilder FooterTemplateHandler(string value)
Parameters:valuestringReturns:

TDropDownBuilder

FooterTemplateId to be used for rendering the static footer of the popup element.

C#
public TDropDownBuilder FooterTemplateId(string footerTemplateId)
Parameters:footerTemplateIdstringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.FooterTemplateId("widgetFooterTemplateId")
)

FooterTemplateView to be used for rendering the static footer of the popup element.

C#
public TDropDownBuilder FooterTemplateView(MvcHtmlString footerTemplateView)
Parameters:footerTemplateViewMvcHtmlStringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.FooterTemplateView(Html.Partial("FooterTemplate"))
)

Group template which will be rendered as a group header of each new group in the popup.

C#
public TDropDownBuilder GroupTemplate(string groupTemplate)
Parameters:groupTemplatestringReturns:

TDropDownBuilder

The Group template which will be rendered as a group header of each new group in the popup.

C#
public TDropDownBuilder GroupTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the fixed group template.

Returns:

TDropDownBuilder

The JavaScript ghandler that returns the Group template which will be rendered as a group header of each new group in the popup.

C#
public TDropDownBuilder GroupTemplateHandler(string value)
Parameters:valuestringReturns:

TDropDownBuilder

GroupTemplateId to be used for rendering the static header of the popup element.

C#
public TDropDownBuilder GroupTemplateId(string groupTemplateId)
Parameters:groupTemplateIdstringReturns:

TDropDownBuilder

GroupTemplateView to be used for rendering the static header of the popup element.

C#
public TDropDownBuilder GroupTemplateView(MvcHtmlString groupTemplateView)
Parameters:groupTemplateViewMvcHtmlStringReturns:

TDropDownBuilder

Header template which will be rendered as a static header of the popup element.

C#
public TDropDownBuilder HeaderTemplate(string headerTemplate)
Parameters:headerTemplatestringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.HeaderTemplate("Customers")
)

Header template which will be rendered as a static header of the popup element.

C#
public TDropDownBuilder HeaderTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the fixed group template.

Returns:

TDropDownBuilder

The JAvaScript function that returns the Header template which will be rendered as a static header of the popup element.

C#
public TDropDownBuilder HeaderTemplateHandler(string value)
Parameters:valuestringReturns:

TDropDownBuilder

HeaderTemplateId to be used for rendering the static header of the popup element.

C#
public TDropDownBuilder HeaderTemplateId(string headerTemplateId)
Parameters:headerTemplateIdstringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.HeaderTemplateId("widgetHeaderTemplateId")
)

HeaderTemplateView to be used for rendering the static header of the popup element.

C#
public TDropDownBuilder HeaderTemplateView(MvcHtmlString headerTemplateView)
Parameters:headerTemplateViewMvcHtmlStringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.HeaderTemplateView(Html.Partial("HeaderTemplate"))
)

Sets the height of the drop-down list in pixels.

C#
public TDropDownBuilder Height(int height)
Parameters:heightintReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.Height(300)
)

Use it to enable case insensitive bahavior of the combobox. If true the combobox will select the first matching item ignoring its casing.

C#
public TDropDownBuilder IgnoreCase(bool ignoreCase)
Parameters:ignoreCaseboolReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().ComboBox()
.Name("ComboBox")
.IgnoreCase(true)
)

Adds a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.

C#
public TDropDownBuilder Label(Action<LabelSettingsBuilder> configurator)
Parameters:configuratorAction<LabelSettingsBuilder>Returns:

TDropDownBuilder

No data template which will be rendered as a static no-data template of the popup element.

C#
public TDropDownBuilder NoDataTemplate(string noDataTemplate)
Parameters:noDataTemplatestringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.NoDataTemplate("No Data!")
)

No data template which will be rendered as a static no-data template of the popup element.

C#
public TDropDownBuilder NoDataTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the fixed group template.

Returns:

TDropDownBuilder

the JavaScript function that returns the No data template which will be rendered as a static no-data template of the popup element.

C#
public TDropDownBuilder NoDataTemplateHandler(string value)
Parameters:valuestringReturns:

TDropDownBuilder

NoDataTemplateId to be used for rendering the static no-data template of the popup element.

C#
public TDropDownBuilder NoDataTemplateId(string noDataTemplateId)
Parameters:noDataTemplateIdstringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.NoDataTemplateId("widgetNoDataTemplateId")
)

NoDataTemplateView to be used for rendering the static no-data template of the popup element.

C#
public TDropDownBuilder NoDataTemplateView(MvcHtmlString noDataTemplateView)
Parameters:noDataTemplateViewMvcHtmlStringReturns:

TDropDownBuilder

Example:
C#
@( Html.Kendo().DropDownList()
.Name("DropDownList")
.NoDataTemplateView(Html.Partial("NoDataTemplate"))
)

Configures the popup settings of the widget.

C#
public TDropDownBuilder Popup(Action<PopupSettingsBuilder> popupAction)
Parameters:popupActionAction<PopupSettingsBuilder>Returns:

TDropDownBuilder

Specifies whether the value of the widget should be treated as a plain string or as a complex object from the data source.

C#
public TDropDownBuilder ValuePrimitive(bool valuePrimitive)
Parameters:valuePrimitiveboolReturns:

TDropDownBuilder

Configures the virtualization settings of the widget.

C#
public TDropDownBuilder Virtual(Action<VirtualSettingsBuilder> virtualizationAction)
Parameters:virtualizationActionAction<VirtualSettingsBuilder>Returns:

TDropDownBuilder

Configures the virtualization settings of the widget.

C#
public TDropDownBuilder Virtual(bool enable)
Parameters:enableboolReturns:

TDropDownBuilder