I am trying to create an ASP .NET Core form that collects information. One of the fields is an autocomplete field that allows searching from an external data source:
<div class="row">
<div class="form-group col-md-6">
<label asp-for="SupplierId" class="control-label"></label>
<ej-autocomplete id="SupplierId" width="100%" show-rounded-corner="true" highlight-search="true" watermark-text="Search..." type="@FilterOperatorType.Contains" min-character="2" case-sensitive-search="false" empty-result-text="Unknown supplier" datasource="ViewBag.Suppliers">
<e-autocomplete-fields text="Name" key="IdStr" />
</ej-autocomplete>
</div>
</div>
The form works correctly and the autocomplete field does its job searching and posting the selected value at submit.
When editing the same information using the form, I provide the populated model to the form and I expect the autocomplete field to be already filled in with the information (like any other input element in the form does), but the autocomplete field is empty.
How can I create an autocomplete field that can be used both for creating and editing a value (such as a supplier name)?