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.
AutoExpandSelection property is available in the following Input DropDown controls;
The following code example demonstrates how to use AutoExpandSelection in the Input control.
IndexController.csRazor |
Copy Code
|
---|---|
public ActionResult Index() { ViewBag.Cities = Models.Cities.GetCities(); return View(); } |
Index.cshtml
Razor |
Copy Code
|
---|---|
@using C1.Web.Mvc; @{ List<string> cities = ViewBag.Cities; } @(Html.C1().ComboBox().Bind(cities).SelectedIndex(0) .AutoExpandSelection(true)) |