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

Defines the fluent API for configuring the Kendo UI ComboBox

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ComboBoxBuilder : MvvmWidgetBuilderBase<ComboBox, ComboBoxBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<ComboBox, ComboBoxBuilder>MvvmWidgetBuilderBase<ComboBox, ComboBoxBuilder>ComboBoxBuilder

Implements: IHtmlContent

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

C#
public ComboBoxBuilder(ComboBox component)
Parameters:componentComboBox

Methods

Specifies the adaptive rendering of the component.

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

The value for AdaptiveMode

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The value for AdaptiveSubtitle

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The value for AdaptiveTitle

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Configures the animation effects of the widget.

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

The action which configures the animation effects.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder for method chaining.

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

Use to enable or disable animation of the popup element.

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

The boolean value.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder for method chaining.

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

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

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

The value for AutoBind

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox")
.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 ComboBoxBuilder AutoWidth(bool value)
Parameters:valuebool

The value for AutoWidth

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

Binds the ComboBox to an IEnumerable list.

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

The data source.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder for method chaining.

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

Binds the ComboBox to a list of SelectListItem.

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

The data source.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder for method chaining.

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

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

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

The value for CascadeFrom

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox2")
.CascadeFrom("ComboBox1")
)

Defines the field to be used to filter the data source. If not defined, it is set to a field with the same name as the parent's dataValueField option.Help topic showing how cascading functionality works

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

The value for CascadeFromField

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox2")
.CascadeFrom("ComboBox1")
.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 ComboBoxBuilder CascadeFromParentField(string value)
Parameters:valuestring

The value for CascadeFromParentField

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox2")
.CascadeFrom("ComboBox1")
.CascadeFromField("ParentID")
.CascadeFromParentField("ParentID")
)

Applicable to a parent ComboBox in a cascading scenario. If set to true cascading will be triggered upon custom input in the parent widget. When set to false (default) the child will not cascade and it will be disabled upon setting custom input in the parent ComboBox. Cascade on custom values works only when cascadeFromParentField is not set for the child combo, or it points to the dataValueField of the parent.

C#
public ComboBoxBuilder CascadeOnCustomValue()
Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Applicable to a parent ComboBox in a cascading scenario. If set to true cascading will be triggered upon custom input in the parent widget. When set to false (default) the child will not cascade and it will be disabled upon setting custom input in the parent ComboBox. Cascade on custom values works only when cascadeFromParentField is not set for the child combo, or it points to the dataValueField of the parent.

C#
public ComboBoxBuilder CascadeOnCustomValue(bool value)
Parameters:valuebool

The value for CascadeOnCustomValue

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox2")
.CascadeFrom("ComboBox1")
.CascadeOnCustomValue()
)

Unless this options is set to false, a button will appear when hovering the widget. Clicking that button will reset the widget's value and will trigger the change event.

C#
public ComboBoxBuilder ClearButton(bool value)
Parameters:valuebool

The value for ClearButton

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox")
.ClearButton(false)
)

Sets the data source configuration of the ComboBox.

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

The lambda which configures the data source

Returns:

ComboBoxBuilder

The id of the external data source that will be used by the ComboBox.

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

The id of the external data source

Returns:

ComboBoxBuilder

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 ComboBoxBuilder DataTextField(string value)
Parameters:valuestring

The value for DataTextField

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The value for DataValueField

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

The delay in milliseconds between a keystroke and when the widget displays the popup.

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

The value for Delay

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder Enable(bool value)
Parameters:valuebool

The value for Enable

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder EnforceMinLength()
Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder EnforceMinLength(bool value)
Parameters:valuebool

The value for EnforceMinLength

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

Configures the client-side events.

C#
public ComboBoxBuilder Events(Action<ComboBoxEventBuilder> configurator)
Parameters:configuratorAction<ComboBoxEventBuilder>

The client events action.

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

Sets a value controlling how the color is applied.

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

The value for FillMode

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

The filtering method used to determine the suggestions for the current value.

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

The value for Filter

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

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

The value for FixedGroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

A Template component that configures the fixedgrouptemplate.

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The handler that returs the template for FixedGroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The ID of the template element for FixedGroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The view that contains the template for FixedGroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder FooterTemplate(string value)
Parameters:valuestring

The value for FooterTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder FooterTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the footertemplate.

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder FooterTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for FooterTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder FooterTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for FooterTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder FooterTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for FooterTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The value for GroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

A Template component that configures the grouptemplate.

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The handler that returs the template for GroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The ID of the template element for GroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The view that contains the template for GroupTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The value for HeaderTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

A Template component that configures the headertemplate.

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The handler that returs the template for HeaderTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The ID of the template element for HeaderTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The view that contains the template for HeaderTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The value for Height

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

If set to true the first suggestion will be automatically highlighted.

C#
public ComboBoxBuilder HighlightFirst(bool value)
Parameters:valuebool

The value for HighlightFirst

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

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

The value for IgnoreCase

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.

C#
public ComboBoxBuilder InputMode(string value)
Parameters:valuestring

The value for InputMode

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("comboBox")
.InputMode("search")
)

Defines the items in the ComboBox

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

The add action.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder for method chaining.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox")
.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 ComboBoxBuilder Label(Action<ComboBoxLabelSettingsBuilder> configurator)
Parameters:configuratorAction<ComboBoxLabelSettingsBuilder>

The ComboBoxLabelSettingsBuilder for the label setting.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder .

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

The label.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder .

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

C#
public ComboBoxBuilder Messages(Action<ComboBoxMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<ComboBoxMessagesSettingsBuilder>

The ComboBoxMessagesSettingsBuilder for the messages setting.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder .

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

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

The value for MinLength

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox")
.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 ComboBoxBuilder NoDataTemplate(string value)
Parameters:valuestring

The value for NoDataTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder NoDataTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the nodatatemplate.

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder NoDataTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for NoDataTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder NoDataTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for NoDataTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder NoDataTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for NoDataTemplate

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

The hint displayed by the widget when it is empty. Not set by default.

C#
public ComboBoxBuilder Placeholder(string value)
Parameters:valuestring

The value for Placeholder

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox")
.Placeholder("Select country...")
)

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

C#
public ComboBoxBuilder Popup(Action<ComboBoxPopupSettingsBuilder> configurator)
Parameters:configuratorAction<ComboBoxPopupSettingsBuilder>

The ComboBoxPopupSettingsBuilder for the popup setting.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder .

The configuration for the prefix adornment of the component.

C#
public ComboBoxBuilder PrefixOptions(Action<ComboBoxPrefixOptionsSettingsBuilder> configurator)
Parameters:configuratorAction<ComboBoxPrefixOptionsSettingsBuilder>

The ComboBoxPrefixOptionsSettingsBuilder for the prefixoptions setting.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder .

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 ComboBoxBuilder Readonly(bool value)
Parameters:valuebool

The value for Readonly

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

Sets a value controlling the border radius.

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

The value for Rounded

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

Use it to set selected item index

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

Item index.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder for method chaining.

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

Sets the size of the component.

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

The value for Size

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox")
.Size(ComponentSize.Medium)
)

The configuration for the suffix adornment of the component.

C#
public ComboBoxBuilder SuffixOptions(Action<ComboBoxSuffixOptionsSettingsBuilder> configurator)
Parameters:configuratorAction<ComboBoxSuffixOptionsSettingsBuilder>

The ComboBoxSuffixOptionsSettingsBuilder for the suffixoptions setting.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder .

If set to true the widget will automatically use the first suggestion as its value.

C#
public ComboBoxBuilder Suggest()
Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

If set to true the widget will automatically use the first suggestion as its value.

C#
public ComboBoxBuilder Suggest(bool value)
Parameters:valuebool

The value for Suggest

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

When set to true the widget will automatically set selected value to the typed custom text. Set the option to false to clear the selected value but keep the custom text.

C#
public ComboBoxBuilder SyncValueAndText(bool value)
Parameters:valuebool

The value for SyncValueAndText

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

Example:
C#
@(Html.Kendo().ComboBox()
.Name("ComboBox")
.SyncValueAndText(false)
)

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

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

The value for Template

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder Template<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the template.

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder TemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for Template

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder TemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for Template

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 ComboBoxBuilder TemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for Template

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

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

The value for Text

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

The value of the widget.

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

The value for Value

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 selected item value field. If set to false, the View-Model field will be updated with the selected item.

C#
public ComboBoxBuilder ValuePrimitive()
Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder 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 selected item value field. If set to false, the View-Model field will be updated with the selected item.

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

The value for ValuePrimitive

Returns:

ComboBoxBuilder

Returns the current ComboBoxBuilder instance.

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

ComboBoxBuilder

Returns the current instance of ComboBoxVirtualSettingsBuilder .

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 ComboBoxBuilder Virtual(Action<ComboBoxVirtualSettingsBuilder> configurator)
Parameters:configuratorAction<ComboBoxVirtualSettingsBuilder>

The ComboBoxVirtualSettingsBuilder for the virtual setting.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxBuilder .

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 ComboBoxBuilder Virtual(bool enabled)
Parameters:enabledbool

Enables or disables the virtual option.

Returns:

ComboBoxBuilder

Returns the current instance of ComboBoxVirtualSettingsBuilder .