ASP.NET Core MVC Controls | ComponentOne
Working with Controls / Input Controls / Common Features / AutoExpandSelection
In This Topic
    AutoExpandSelection
    In This Topic

    You can use the AutoExpandSelection property to specify whether DropDown control automatically fills the text box portion of a combo box with a value from the combo box list that matches the characters you enter as you type in the combo box.

    Note: In case of InputColor and InputDate control, the default value of AutoExpandSelection property is set to True. For all the other Input controls the default value is False.

    AutoExpandSelection property is available in the following Input DropDown controls;

    The following code example demonstrates how to use AutoExpandSelection in the Input control.

    IndexController.cs
    Razor
    Copy Code
    public ActionResult Index()
      {
    ViewBag.Cities = Models.Cities.GetCities();
    return View();
       }
    


    Index.cshtml

    Razor
    Copy Code
    @{
        List<string> cities = ViewBag.Cities;
    <div>
        <c1-combo-box selected-index=0 auto-expand-selection="true">
            <c1-items-source source-collection=@cities></c1-items-source>
        </c1-combo-box>
    </div>