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

Kendo UI AutoComplete TagHelper AutoCompleteTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("kendo-autocomplete")]
[HtmlTargetElement("autocomplete-editor", ParentTag = "form-item")]
[HtmlTargetElement("autocomplete-editor", ParentTag = "property-grid-item")]
[RestrictChildren("popup-animation", new string[] { "popup", "virtual", "datasource", "messages", "label", "prefix-options", "suffix-options", "fixed-group-template", "footer-template", "header-template", "no-data-template", "group-template", "item-template" })]
[OutputElementHint("div")]
public class AutoCompleteTagHelper : DropDownBaseTagHelper, ITagHelper, ITagHelperComponent, IDataBoundWidget<DataSourceTagHelper>, ITemplateComponent, IKendoFormEditor

Inheritance: objectTagHelperTagHelperBaseDropDownBaseTagHelperAutoCompleteTagHelper

Implements: IDataBoundWidget<DataSourceTagHelper>IKendoFormEditorITagHelperITagHelperComponentITemplateComponent

Inherited Members DropDownBaseTagHelper.AnimationDropDownBaseTagHelper.PopupDropDownBaseTagHelper.VirtualDropDownBaseTagHelper.DatasourceDropDownBaseTagHelper.DatasourceIdDropDownBaseTagHelper.BindToDropDownBaseTagHelper.TemplatesTagHelperBase.MinimumValidatorTagHelperBase.MaximumValidatorTagHelperBase.Init(TagHelperContext)TagHelperBase.Process(TagHelperContext, TagHelperOutput)TagHelperBase.GetInitializator()TagHelperBase.VerifySettings()TagHelperBase.SerializeTemplates()TagHelperBase.GenerateId(TagHelperOutput)TagHelperBase.CreateHandler(string)TagHelperBase.GetRangeValidationParameter<TValue>(ModelExplorer, string)TagHelperBase.ExtractEditFormat(string)TagHelperBase.ToDictionaryHandler(IDictionary<string, string>)TagHelperBase.AddSelfToTemplate(TagHelperContext)TagHelperBase.ViewContextTagHelperBase.GeneratorTagHelperBase.InitializerTagHelperBase.WriterTagHelperBase.ScriptAttributesTagHelperBase.NameTagHelperBase.IdTagHelperBase.SelectorTagHelperBase.IdPrefixTagHelperBase.IsInClientTemplateTagHelperBase.DeferredTagHelperBase.AsModuleTagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

   <kendo-autocomplete name="products" filter="FilterType.Contains"
                   datatextfield="ProductName"
                   min-length="3" style="width: 100%;">
       <datasource type="DataSourceTagHelperType.Custom" server-filtering="true">
           <transport>
               <read url="@Url.Action("GetProducts", "Home")" data="onAdditionalData" />
           </transport>
       </datasource>
   </kendo-autocomplete>

   <script>
       function onAdditionalData() {
           return {
               text: $("#products").val() // sends the typed value from the AutoComplete to the server
           };
       }
   </script>

Constructors

Initializes a new instance of the AutoCompleteTagHelper class.

C#
public AutoCompleteTagHelper(IKendoHtmlGenerator generator)
Parameters:generatorIKendoHtmlGenerator

Properties

Specifies the adaptive rendering of the component.

C#
public AdaptiveMode? AdaptiveMode { get; set; }

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

C#
public string AdaptiveSubtitle { get; set; }

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

C#
public string AdaptiveTitle { get; set; }

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

C#
public bool? AutoWidth { get; set; }

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 bool? ClearButton { get; set; }

The field of the data item used when searching for suggestions. This is the text that will be displayed in the list of matched results.

C#
[HtmlAttributeName("datatextfield")]
public string DataTextField { get; set; }

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

C#
public double? Delay { get; set; }

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 bool? Enable { get; set; }

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 bool? EnforceMinLength { get; set; }

Sets a value controlling how the color is applied.

C#
public FillMode? FillMode { get; set; }

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

C#
public FilterType? Filter { get; set; }

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

C#
public string FixedGroupTemplate { get; set; }

The template used to render the fixed header group. By default the widget displays only the value of the current group. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string FixedGroupTemplateHandler { get; set; }

The template used to render the fixed header group. By default the widget displays only the value of the current group. This option expects the ID of the script element that contains the template.

C#
public string FixedGroupTemplateId { get; set; }

The template used to render the fixed header group. By default the widget displays only the value of the current group. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent FixedGroupTemplateView { get; set; }

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 string FooterTemplate { get; set; }

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. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string FooterTemplateHandler { get; set; }

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. This option expects the ID of the script element that contains the template.

C#
public string FooterTemplateId { get; set; }

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. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent FooterTemplateView { get; set; }

An expression to be evaluated against the current model.

C#
public ModelExpression For { get; set; }

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

C#
public string GroupTemplate { get; set; }

The template used to render the groups. By default the widget displays only the value of the group. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string GroupTemplateHandler { get; set; }

The template used to render the groups. By default the widget displays only the value of the group. This option expects the ID of the script element that contains the template.

C#
public string GroupTemplateId { get; set; }

The template used to render the groups. By default the widget displays only the value of the group. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent GroupTemplateView { get; set; }

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

C#
public string HeaderTemplate { get; set; }

Specifies a static HTML content, which will be rendered as a header of the popup element. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string HeaderTemplateHandler { get; set; }

Specifies a static HTML content, which will be rendered as a header of the popup element. This option expects the ID of the script element that contains the template.

C#
public string HeaderTemplateId { get; set; }

Specifies a static HTML content, which will be rendered as a header of the popup element. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent HeaderTemplateView { get; set; }

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

C#
public double? Height { get; set; }

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

C#
public bool? HighlightFirst { get; set; }

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

C#
public bool? IgnoreCase { get; set; }

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 string InputMode { get; set; }

IsNested member.

C#
[HtmlAttributeNotBound]
public bool IsNested { get; set; }

Implements: IKendoFormEditor.IsNested

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#
[HtmlAttributeName("label")]
public string LabelValue { get; set; }

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 double? MinLength { get; set; }

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 string NoDataTemplate { get; set; }

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. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string NoDataTemplateHandler { get; set; }

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. This option expects the ID of the script element that contains the template.

C#
public string NoDataTemplateId { get; set; }

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. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent NoDataTemplateView { get; set; }

The name of the JavaScript function that will handle the change event. Fired when the value of the widget is changed by the user.The event handler function context (available through the keyword this) will be set to the widget instance.

C#
public string OnChange { get; set; }

The name of the JavaScript function that will handle the close event. Fired when the suggestion popup of the widget is closed by the user.The event handler function context (available through the keyword this) will be set to the widget instance.

C#
public string OnClose { get; set; }

The name of the JavaScript function that will handle the dataBound event. Fired when the widget is bound to data from its data source.The event handler function context (available through the keyword this) will be set to the widget instance.

C#
public string OnDataBound { get; set; }

The name of the JavaScript function that will handle the filtering event. Fired when the widget is about to filter the data source.The event handler function context (available through the keyword this) will be set to the widget instance.

C#
public string OnFiltering { get; set; }

The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the AutoComplete is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public string OnKendoKeydown { get; set; }

The name of the JavaScript function that will handle the open event. Fired when the suggestion popup of the widget is opened by the user.The event handler function context (available through the keyword this) will be set to the widget instance.

C#
public string OnOpen { get; set; }

The name of the JavaScript function that will handle the select event. Fired when an item from the suggestion popup is selected by the user.

C#
public string OnSelect { get; set; }

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

C#
public string Placeholder { get; set; }

Sets a value controlling the border radius.

C#
public Rounded? Rounded { get; set; }

The character used to separate multiple values. Empty by default.

C#
public string Separator { get; set; }

Sets the size of the component.

C#
public ComponentSize? Size { get; set; }

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

C#
public bool? Suggest { get; set; }

The template used to render the suggestions. By default the widget displays only the text of the suggestion (configured via dataTextField).

C#
public string Template { get; set; }

The template used to render the suggestions. By default the widget displays only the text of the suggestion (configured via dataTextField). This option expects the name of a JavaScript function that will be called to return the template.

C#
public string TemplateHandler { get; set; }

The template used to render the suggestions. By default the widget displays only the text of the suggestion (configured via dataTextField). This option expects the ID of the script element that contains the template.

C#
public string TemplateId { get; set; }

The template used to render the suggestions. By default the widget displays only the text of the suggestion (configured via dataTextField). This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent TemplateView { get; set; }

The value of the widget.

C#
public string Value { get; set; }

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

C#
public bool? ValuePrimitive { get; set; }

Methods

Gets the initialization script.

C#
protected override string GetInitializationScript()
Returns:

string

The initialization script.

Overrides: DropDownBaseTagHelper.GetInitializationScript()

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelper.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: TagHelperBase.Serialize()

SerializeEvents method.

C#
protected override Dictionary<string, object> SerializeEvents()
Returns:

Dictionary<string, object>

Overrides: DropDownBaseTagHelper.SerializeEvents()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: DropDownBaseTagHelper.SerializeSettings()

TryAddAsEditor method.

C#
public bool TryAddAsEditor(TagHelperContext context)
Parameters:contextTagHelperContextReturns:

bool

The result.

Implements: IKendoFormEditor.TryAddAsEditor(TagHelperContext)

Writes the HTML output.

C#
protected override void WriteHtml(TagHelperOutput output)
Parameters:outputTagHelperOutput

The TagHelper output.

Overrides: DropDownBaseTagHelper.WriteHtml(TagHelperOutput)