Search results

Autofill supported with ComboBox

The ComboBox supports the autofill behaviour with the help of autofill property. Whenever you change the input value, the ComboBox will autocomplete your data by matching the typed character. Suppose, if no matches found then, comboBox doesn’t suggest any item.

In the following sample, showcase that how to work autofill with ComboBox.

tagHelper
autofill.cs
<div class="control-wrapper">
    <div id="default" style='padding-top:75px;'>
        <ejs-combobox id="games" dataSource="@ViewBag.data" autofill="true" placeholder="Select a game" index="2" popupHeight="220px">
            <e-combobox-fields value="Id" text="Game"></e-combobox-fields>
        </ejs-combobox>
    </div>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers
{
    public class ComboBoxController : Controller
    {
         public IActionResult autofill()
        {
            ViewBag.data = new Countries().CountriesList();
            return View();
        }
    }
}