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

Defines the fluent API for configuring the Kendo UI DropDownList

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class DropDownListBuilder : MvvmWidgetBuilderBase<DropDownList, DropDownListBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<DropDownList, DropDownListBuilder>MvvmWidgetBuilderBase<DropDownList, DropDownListBuilder>DropDownListBuilder

Implements: IHtmlContent

Inherited Members MvvmWidgetBuilderBase<DropDownList, DropDownListBuilder>.UseMvvmInitialization(bool)MvvmWidgetBuilderBase<DropDownList, DropDownListBuilder>.UseMvvmInitialization()WidgetBuilderBase<DropDownList, DropDownListBuilder>.ToComponent()WidgetBuilderBase<DropDownList, DropDownListBuilder>.Expression(string)WidgetBuilderBase<DropDownList, DropDownListBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<DropDownList, DropDownListBuilder>.Name(string)WidgetBuilderBase<DropDownList, DropDownListBuilder>.Deferred(bool)WidgetBuilderBase<DropDownList, DropDownListBuilder>.HtmlAttributes(object)WidgetBuilderBase<DropDownList, DropDownListBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<DropDownList, DropDownListBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<DropDownList, DropDownListBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<DropDownList, DropDownListBuilder>.Render()WidgetBuilderBase<DropDownList, DropDownListBuilder>.ToHtmlString()WidgetBuilderBase<DropDownList, DropDownListBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<DropDownList, DropDownListBuilder>.ToClientTemplate()WidgetBuilderBase<DropDownList, DropDownListBuilder>.AsModule(bool)WidgetBuilderBase<DropDownList, DropDownListBuilder>.ComponentWidgetBuilderBase<DropDownList, DropDownListBuilder>.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 DropDownListBuilder class.

C#
public DropDownListBuilder(DropDownList component)
Parameters:componentDropDownList

Methods

Specifies the adaptive rendering of the component.

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

The value for AdaptiveMode

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

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

The value for AdaptiveSubtitle

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

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

The value for AdaptiveTitle

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Configures the animation effects of the widget.

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

The action which configures the animation effects.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

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 DropDownListBuilder Animation(bool enable)
Parameters:enablebool

The boolean value.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

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

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

C#
public DropDownListBuilder AutoBind(bool value)
Parameters:valuebool

The value for AutoBind

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.AutoBind(false)
)

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

C#
public DropDownListBuilder AutoWidth(bool value)
Parameters:valuebool

The value for AutoWidth

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.AutoWidth(false)
)

Binds the DropDownList to an IEnumerable list.

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

The data source.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

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"
}
} )
)

Binds the DropDownList to a list of SelectListItem.

C#
public DropDownListBuilder BindTo(IEnumerable<SelectListItem> dataSource)
Parameters:dataSourceIEnumerable<SelectListItem>

The data source.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.BindTo(new List &lt;SelectListItem&gt;
{
new SelectListItem() {
Text = "Text1",
Value = "Value1"
},
new SelectListItem() {
Text = "Text2",
Value = "Value2"
}
} )
)

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

C#
public DropDownListBuilder CascadeFrom(string value)
Parameters:valuestring

The value for CascadeFrom

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList2")
.CascadeFrom("DropDownList1")
)

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

C#
public DropDownListBuilder CascadeFromField(string value)
Parameters:valuestring

The value for CascadeFromField

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList2")
.CascadeFrom("DropDownList1")
.CascadeFromField("ParentID")
)

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.

C#
public DropDownListBuilder CascadeFromParentField(string value)
Parameters:valuestring

The value for CascadeFromParentField

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList2")
.CascadeFrom("DropDownList1")
.CascadeFromField("ParentID")
.CascadeFromParentField("ParentID")
)

Sets the data source configuration of the DropDownList.

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

The lambda which configures the data source

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

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

Sets a standalone DataSource Component as data source of the DropDownList.

C#
public DropDownListBuilder DataSource(string dataSourceId)
Parameters:dataSourceIdstring

The id of the external dataSource widget.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.DataSource("dataSourceName")
)

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.

C#
public DropDownListBuilder DataTextField(string value)
Parameters:valuestring

The value for DataTextField

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder DataValueField(string value)
Parameters:valuestring

The value for DataValueField

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

Specifies the delay in milliseconds before the search-text typed by the end user is sent for filtering.

C#
public DropDownListBuilder Delay(double value)
Parameters:valuedouble

The value for Delay

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

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

The value for Enable

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder EnforceMinLength()
Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder EnforceMinLength(bool value)
Parameters:valuebool

The value for EnforceMinLength

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.MinLength(3)
.Filter("contains")
.EnforceMinLength(true)
)

Configures the client-side events.

C#
public DropDownListBuilder Events(Action<DropDownListEventBuilder> configurator)
Parameters:configuratorAction<DropDownListEventBuilder>

The client events action.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.Events(events =&gt; events
.Change("onChange")
)
)

Sets a value controlling how the color is applied.

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

The value for FillMode

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.FillMode(FillMode.Solid)
)

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

C#
public DropDownListBuilder Filter(FilterType value)
Parameters:valueFilterType

The value for Filter

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.Filter(FilterType.Contains);
)

When filtering is enabled, allows custom title to be defined for the filter input element.

C#
public DropDownListBuilder FilterTitle(string value)
Parameters:valuestring

The value for FilterTitle

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.FilterTitle("MyFilter")
)

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

C#
public DropDownListBuilder FixedGroupTemplate(string value)
Parameters:valuestring

The value for FixedGroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

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

A Template component that configures the fixedgrouptemplate.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder FixedGroupTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for FixedGroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder FixedGroupTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for FixedGroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder FixedGroupTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for FixedGroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder FooterTemplate(string value)
Parameters:valuestring

The value for FooterTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

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

A Template component that configures the footertemplate.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder FooterTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for FooterTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder FooterTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for FooterTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder FooterTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for FooterTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder GroupTemplate(string value)
Parameters:valuestring

The value for GroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

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

A Template component that configures the grouptemplate.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder GroupTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for GroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder GroupTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for GroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder GroupTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for GroupTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder HeaderTemplate(string value)
Parameters:valuestring

The value for HeaderTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

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

A Template component that configures the headertemplate.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder HeaderTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for HeaderTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder HeaderTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for HeaderTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder HeaderTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for HeaderTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder Height(double value)
Parameters:valuedouble

The value for Height

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder IgnoreCase(bool value)
Parameters:valuebool

The value for IgnoreCase

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Defines the items in the DropDownList

C#
public DropDownListBuilder Items(Action<SelectListItemFactory> addAction)
Parameters:addActionAction<SelectListItemFactory>

The add action.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.Items(items =&gt;
{
items.Add().Text("First Item");
items.Add().Text("Second Item");
})
)

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 DropDownListBuilder Label(Action<DropDownListLabelSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownListLabelSettingsBuilder>

The DropDownListLabelSettingsBuilder for the label setting.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder .

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 DropDownListBuilder Label(string label)
Parameters:labelstring

The label.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder .

The text messages displayed in the widget. Use this option to customize or localize the messages.

C#
public DropDownListBuilder Messages(Action<DropDownListMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownListMessagesSettingsBuilder>

The DropDownListMessagesSettingsBuilder for the messages setting.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder .

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.

C#
public DropDownListBuilder MinLength(double value)
Parameters:valuedouble

The value for MinLength

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.MinLength(3)
)

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.

C#
public DropDownListBuilder NoDataTemplate(string value)
Parameters:valuestring

The value for NoDataTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

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

A Template component that configures the nodatatemplate.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder NoDataTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for NoDataTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder NoDataTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for NoDataTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder NoDataTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for NoDataTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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.

C#
public DropDownListBuilder OptionLabel(object value)
Parameters:valueobject

The value for OptionLabel

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.DataTextField("Text")
.DataValueField("Value")
.OptionLabel(new { Text = "Text1", Value = "Value1" })
)

The template used to render the option label. Use optionLabelTemplate if you want to customize the markup of the optionLabel.

C#
public DropDownListBuilder OptionLabelTemplate(string value)
Parameters:valuestring

The value for OptionLabelTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.OptionLabelTemplate("#= data #")
)

The template used to render the option label. Use optionLabelTemplate if you want to customize the markup of the optionLabel.

C#
public DropDownListBuilder OptionLabelTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the optionlabeltemplate.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

The template used to render the option label. Use optionLabelTemplate if you want to customize the markup of the optionLabel.

C#
public DropDownListBuilder OptionLabelTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for OptionLabelTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

The template used to render the option label. Use optionLabelTemplate if you want to customize the markup of the optionLabel.

C#
public DropDownListBuilder OptionLabelTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for OptionLabelTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.OptionLabelTemplateId("widgetOptionLabelTemplateId")
)

The template used to render the option label. Use optionLabelTemplate if you want to customize the markup of the optionLabel.

C#
public DropDownListBuilder OptionLabelTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for OptionLabelTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.OptionLabelTemplateView(Html.Partial("OptionLabelTemplate"))
)

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

C#
public DropDownListBuilder Popup(Action<DropDownListPopupSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownListPopupSettingsBuilder>

The DropDownListPopupSettingsBuilder for the popup setting.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder .

If set to true, the widget will be readonly and will not allow user input. The widget is not readonly be default and allow user input.

C#
public DropDownListBuilder Readonly(bool value)
Parameters:valuebool

The value for Readonly

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.Readonly(true);
)

Sets a value controlling the border radius.

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

The value for Rounded

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.Rounded(Rounded.Medium)

)

Use it to set selected item index

C#
public DropDownListBuilder SelectedIndex(int value)
Parameters:valueint

Item index.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder to allow method chaining.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.SelectedIndex(0);
)

Sets the size of the component.

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

The value for Size

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder Template(string value)
Parameters:valuestring

The value for Template

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder Template<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the template.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder TemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for Template

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder TemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for Template

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder TemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for Template

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

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

The value for Text

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.Text("Chai")
.AutoBind(false)
)

The value of the widget.

C#
public DropDownListBuilder Value(string value)
Parameters:valuestring

The value for Value

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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 primitive value of the selected item's field (defined in the dataValueField option).if set to false, the View-Model field will be updated with the selected item - the entire non-primitive object.

C#
public DropDownListBuilder ValuePrimitive()
Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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 primitive value of the selected item's field (defined in the dataValueField option).if set to false, the View-Model field will be updated with the selected item - the entire non-primitive object.

C#
public DropDownListBuilder ValuePrimitive(bool value)
Parameters:valuebool

The value for ValuePrimitive

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder ValueTemplate(string value)
Parameters:valuestring

The value for ValueTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.ValueTemplate("#= data #")
)

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

C#
public DropDownListBuilder ValueTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the valuetemplate.

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder ValueTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for ValueTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

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

C#
public DropDownListBuilder ValueTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for ValueTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.ValueTemplateId("widgetValueTemplateId")
)

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

C#
public DropDownListBuilder ValueTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for ValueTemplate

Returns:

DropDownListBuilder

Returns the current DropDownListBuilder instance.

Example:
C#
@(Html.Kendo().DropDownList()
.Name("DropDownList")
.ValueTemplateView(Html.Partial("ValueTemplate"))
)

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.

C#
public DropDownListBuilder Virtual()
Returns:

DropDownListBuilder

Returns the current instance of 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.

C#
public DropDownListBuilder Virtual(Action<DropDownListVirtualSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownListVirtualSettingsBuilder>

The DropDownListVirtualSettingsBuilder for the virtual setting.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListBuilder .

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.

C#
public DropDownListBuilder Virtual(bool enabled)
Parameters:enabledbool

Enables or disables the virtual option.

Returns:

DropDownListBuilder

Returns the current instance of DropDownListVirtualSettingsBuilder .