How to Enable Autofill in ASP.NET CORE AutoComplete

27 Aug 20261 minute to read

The AutoComplete supports the autofill behavior with the help of the autofill property. To enable autofill, set the autofill property to true. Whenever you change the input value, the AutoComplete will autocomplete your data by matching the typed character. If no matches are found, the AutoComplete does not apply the inline completion.

The following sample shows how to use the autofill property with the AutoComplete.

@using AutoCompleteCustomSample.Models;
@{
    var data = new Countries().CountriesList();
}
<div class="control-wrapper">
    <div id="default" style='padding-top:75px;margin:0 auto;width:250px;'>
        <ejs-autocomplete id="country" datasource="@data" placeholder="e.g. India" autofill="true" popupheight="220px">
            <e-autocomplete-fields value="Name"></e-autocomplete-fields>
        </ejs-autocomplete>
    </div>
</div>

View Sample in GitHub.