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

AutoCompleteBuilder

Methods

ClearButton(System.Boolean)

Enables or disables the clear button. This button resets the component's value and triggers the Change event.

Parameters

enable - System.Boolean

The boolean value.

Example


            @(Html.Kendo().AutoComplete()
                .Name("AutoComplete")
                .ClearButton(false) // Disable the clear button.
            )

AutoWidth(System.Boolean)

If enabled, AutoComplete automatically adjusts the width of the popup element and does not wrap up the item label. Note: Virtualized list does not support the AutoWidth functionality.

Parameters

autoWidth - System.Boolean

Example


             @(Html.Kendo().AutoComplete()
                .Name("AutoComplete")
                .AutoWidth(true)
            )

EnforceMinLength(System.Boolean)

If set to true, AutoComplete will not show all items when the text of the search input is cleared. By default, the AutoComplete shows all items when the text of the search input is cleared.

Parameters

enforceMinLength - System.Boolean

Example


             @(Html.Kendo().AutoComplete()
                .Name("AutoComplete")
                .EnforceMinLength(true)
            )

Events(System.Action)

Configures the client-side events.

Parameters

clientEventsAction - System.Action<AutoCompleteEventBuilder>

The action that sets the client-side events.

Example


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

Filter(System.String)

The filtering method used to determine the suggestions for the current value. The default filter value is "startswith" - all data items that begin with the current component value are displayed in the suggestion popup. The supported filter values are "startswith", "endswith" and "contains".

Parameters

filter - System.String

The value of the filter operator.

Example


             @(Html.Kendo().AutoComplete()
                .Name("AutoComplete")
                .Filter("contains")
            )

Filter(Kendo.Mvc.UI.FilterType)

The filtering method used to determine the suggestions for the current value. The default filter value is "startswith" - all data items that begin with the current component value are displayed in the suggestion popup. The supported FilterType values are "StartsWith" and "Contains".

Parameters

filter - FilterType

Example


             @(Html.Kendo().AutoComplete()
                .Name("AutoComplete")
                .Filter(FilterType.Contains)
            )

HighlightFirst(System.Boolean)

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

Parameters

highlightFirst - System.Boolean

The boolean value.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .HighlightFirst(true)
            )

Messages(System.Action)

The text messages displayed in the AutoComplete. Use the Messages configuration to customize or localize the default messages.

Parameters

configurator - System.Action<MessagesSettingsBuilder>

The action that configures the messages.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .Messages(messages => messages
                            .NoData("No available records"))
            )

MinLength(System.Int32)

Specifies the minimum number of characters the user must type before a search is performed.

Parameters

length - System.Int32

The value for MinLength.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .MinLength(3)
            )

Placeholder(System.String)

The hint displayed by the AutoComplete when it is empty. It is not set by default.

Parameters

placeholder - System.String

The value for the placeholder.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .Placeholder("Type a customer name...")
            )

Separator(System.String)

The character used to separate multiple values. Empty by default. All separators will be replaced with the first array item, which acts as a default separator. Using the separator option will still bind the primitive stringe value of the input. In case you need to bind multiple data items, you can consider the MultiSelect component.

Parameters

separator - System.String

The values for the separator.

Example


              @(Html.Kendo().AutoComplete()
                         .Name("AutoComplete")
                         .Separator(", ")
             )

Separator(System.String[])

The character used to separate multiple values. Empty by default. All separators will be replaced with the first array item, which acts as a default separator. Using the separator option will still bind the primitive stringe value of the input. In case you need to bind multiple data items, you can consider the MultiSelect component.

Parameters

separators - System.String[]

The values for the separators.

Example


              @(Html.Kendo().AutoComplete()
                         .Name("AutoComplete")
                         .Separator(new string[2] {", ", ": " })
             )

Suggest(System.Boolean)

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

Parameters

suggest - System.Boolean

The boolean value.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .Suggest(true)
            )

Size(Kendo.Mvc.UI.ComponentSize)

Sets the size of the component. The supported values are: "Small", "Medium", "Large", "None".

Parameters

value - ComponentSize

The value for Size.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .Size(ComponentSize.Large)
            )

Rounded(Kendo.Mvc.UI.Rounded)

Configures the border radius of the component. The supported values are: "Small", "Medium", "Large", "Full", "None".

Parameters

value - Rounded

The value for Rounded.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .Rounded(Rounded.Full)
            )

FillMode(Kendo.Mvc.UI.FillMode)

Controls how the color is applied to the component.

Parameters

value - FillMode

The value for FillMode.

Example


             @(Html.Kendo().AutoComplete()
                        .Name("AutoComplete")
                        .FillMode(FillMode.Solid)
            )

PrefixOptions(System.Action)

The configuration for the prefix adornment of the widget.

Parameters

configurator - System.Action<PrefixOptionsSettingsBuilder>

The action that configures the prefix options.

SuffixOptions(System.Action)

The configuration for the suffix adornment of the widget.

Parameters

configurator - System.Action<SuffixOptionsSettingsBuilder>

The action that configures the suffix options.

Template(System.String)

Template to be used for rendering the items in the list.

Parameters

template - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .Template("#= data #")
            )

TemplateId(System.String)

TemplateId to be used for rendering the items in the list.

Parameters

templateId - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .TemplateId("widgetTemplateId")
            )

TemplateView(System.Web.Mvc.MvcHtmlString)

TemplateView to be used for rendering the items in the list.

Parameters

templateView - System.Web.Mvc.MvcHtmlString

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .TemplateView(Html.Partial("TemplateView"))
            )

TemplateHandler(System.String)

The JavaScript function that returns the Template to be used for rendering the items in the list.

Parameters

template - System.String

Template(Kendo.Mvc.UI.TemplateBuilder)

Template to be used for rendering the items in the list.

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the fixed group template.

Value(System.String)

Sets the value of the widget.

Parameters

value - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .Value("1")
            )

Animation(System.Boolean)

Use to enable or disable animation of the popup element.

Parameters

enable - System.Boolean

The boolean value.

Example


            @( Html.Kendo().DropDownList()
                       .Name("DropDownList")
                       .Animation(false) //toggle effect
            )

Animation(System.Action)

Configures the animation effects of the widget.

Parameters

animationAction - System.Action<PopupAnimationBuilder>

The action which configures the animation effects.

Example


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

BindTo(System.Collections.IEnumerable)

Binds the widget to an IEnumerable list.

Parameters

data - System.Collections.IEnumerable

The data source.

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .DataTextField("CompanyName")
                        .DataValueField("CompanyID")
                        .BindTo(new List<Company>
                        {
                            new Company {
                                CompanyName = "Text1",
                                CompanyID = "Value1"
                            },
                            new Company {
                                CompanyName = "Text2",
                                CompanyID = "Value2"
                            } })
            )

DataTextField(System.String)

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

Parameters

field - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .DataTextField("Text")
            )

DataSource(System.Action)

Configures the DataSource options.

Parameters

configurator - System.Action<ReadOnlyDataSourceBuilder>

The DataSource configurator action.

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .DataSource(source =>
                        {
                            source.Read(read =>
                            {
                                read.Action("GetProducts", "Home");
                            });
                        })
            )

DataSource(System.String)

Parameters

dataSourceId - System.String

Delay(System.Int32)

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

Parameters

delay - System.Int32

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .Delay(300)
            )

Enable(System.Boolean)

Enables or disables the combobox.

Parameters

value - System.Boolean

FixedGroupTemplate(System.String)

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

Parameters

fixedGroupTemplate - System.String

FixedGroupTemplateId(System.String)

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

Parameters

fixedGroupTemplateId - System.String

FixedGroupTemplateView(System.Web.Mvc.MvcHtmlString)

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

Parameters

fixedGroupTemplateView - System.Web.Mvc.MvcHtmlString

FixedGroupTemplateHandler(System.String)

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

Parameters

value - System.String

FixedGroupTemplate(Kendo.Mvc.UI.TemplateBuilder)

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

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the fixed group template.

GroupTemplate(System.String)

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

Parameters

groupTemplate - System.String

GroupTemplateId(System.String)

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

Parameters

groupTemplateId - System.String

GroupTemplateView(System.Web.Mvc.MvcHtmlString)

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

Parameters

groupTemplateView - System.Web.Mvc.MvcHtmlString

GroupTemplateHandler(System.String)

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

Parameters

value - System.String

GroupTemplate(Kendo.Mvc.UI.TemplateBuilder)

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

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the fixed group template.

IgnoreCase(System.Boolean)

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

Parameters

ignoreCase - System.Boolean

Example


             @( Html.Kendo().ComboBox()
                        .Name("ComboBox")
                        .IgnoreCase(true)
            )

Height(System.Int32)

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

Parameters

height - System.Int32

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .Height(300)
            )

HeaderTemplate(System.String)

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

Parameters

headerTemplate - System.String

Example

 ")
            )

HeaderTemplateId(System.String)

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

Parameters

headerTemplateId - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .HeaderTemplateId("widgetHeaderTemplateId")
            )

HeaderTemplateView(System.Web.Mvc.MvcHtmlString)

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

Parameters

headerTemplateView - System.Web.Mvc.MvcHtmlString

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .HeaderTemplateView(Html.Partial("HeaderTemplate"))
            )

HeaderTemplateHandler(System.String)

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

Parameters

value - System.String

HeaderTemplate(Kendo.Mvc.UI.TemplateBuilder)

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

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the fixed group template.

FooterTemplate(System.String)

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

Parameters

footerTemplate - System.String

Example

  items found")
            )

FooterTemplateId(System.String)

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

Parameters

footerTemplateId - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .FooterTemplateId("widgetFooterTemplateId")
            )

FooterTemplateView(System.Web.Mvc.MvcHtmlString)

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

Parameters

footerTemplateView - System.Web.Mvc.MvcHtmlString

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .FooterTemplateView(Html.Partial("FooterTemplate"))
            )

FooterTemplateHandler(System.String)

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

Parameters

value - System.String

FooterTemplate(Kendo.Mvc.UI.TemplateBuilder)

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

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the fixed group template.

NoDataTemplate(System.String)

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

Parameters

noDataTemplate - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .NoDataTemplate("No Data!")
            )

NoDataTemplateId(System.String)

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

Parameters

noDataTemplateId - System.String

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .NoDataTemplateId("widgetNoDataTemplateId")
            )

NoDataTemplateView(System.Web.Mvc.MvcHtmlString)

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

Parameters

noDataTemplateView - System.Web.Mvc.MvcHtmlString

Example


             @( Html.Kendo().DropDownList()
                        .Name("DropDownList")
                        .NoDataTemplateView(Html.Partial("NoDataTemplate"))
            )

NoDataTemplateHandler(System.String)

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

Parameters

value - System.String

NoDataTemplate(Kendo.Mvc.UI.TemplateBuilder)

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

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the fixed group template.

Popup(System.Action)

Configures the popup settings of the widget.

Parameters

popupAction - System.Action<PopupSettingsBuilder>

ValuePrimitive(System.Boolean)

Parameters

valuePrimitive - System.Boolean

Virtual(System.Boolean)

Configures the virtualization settings of the widget.

Parameters

enable - System.Boolean

Virtual(System.Action)

Configures the virtualization settings of the widget.

Parameters

virtualizationAction - System.Action<VirtualSettingsBuilder>

Label(System.Action)

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.

Parameters

configurator - System.Action<LabelSettingsBuilder>

AdaptiveMode(Kendo.Mvc.UI.AdaptiveMode)

Parameters

value - AdaptiveMode

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?