This is a migrated thread and some comments may be shown as answers.

Autocomplete in a form

1 Answer 189 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Johan
Top achievements
Rank 1
Johan asked on 09 Jul 2019, 11:36 AM

Hi,

 

Is it possible to have an autocomplete input field in a form, ASP.NET Core,  and send back for example customer name to the pagemodel?

 

Best regards,

 

Johan

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 11 Jul 2019, 02:00 PM
Hi Johan,

The Kendo UI AutoComplete widget can be used as an editor for a model's field. In order to bind it to the field, you should use the following syntax:

@model IndexModel
 
@(Html.Kendo().AutoCompleteFor(m => m.ProductName)
    .DataTextField("ProductName")
    .BindTo((System.Collections.IEnumerable)ViewData["products"])
)

This would bind the AutoComplete to the specific field. So that when a new item is selected, it would be applied to the field as well. It would still depend on the type of data that the AutoComplete is bound to. If you share additional details on the exact scenario that you are willing to achieve, I would be able to provide more accurate suggestions.

Let me know in case further assistance is required.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
AutoComplete
Asked by
Johan
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or