MultiAutoComplete
MultiAutoComplete
Overview
This sample shows the basic usage of the MultiAutoComplete control.
Features
Type in a country name
Albania×
Description
The MultiAutoComplete control allows users to pick items from lists that contain custom objects or simple strings.
In this sample, the MultiAutoComplete control uses a string array as its ItemsSource. The maximum number of token fields is set to 4.
1 2 3 4 5 6 7 8 9 10 11 12 | using Microsoft.AspNetCore.Mvc; namespace MvcExplorer.Controllers { public partial class MultiAutoCompleteController : Controller { public ActionResult Index() { return View(Models.Countries.GetCountries()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | @model List< string > @section Styles{ < style > .highlight { background-color: #ff0; color: #000; } </ style > } < p > @Html .Raw(MultiAutoCompleteRes.Index_Text0)</ p > < c1-multi-auto-complete css-match = "highlight" max-selected-items = "4" selected-indexes= "new List<int> { 1 }" > < c1-items-source source-collection = "@Model" ></ c1-items-source > </ c1-multi-auto-complete > @section Summary{ @Html .Raw(MultiAutoCompleteRes.Index_Text3) } @section Description{ < p > @Html .Raw(MultiAutoCompleteRes.Index_Text1)</ p > < p > @Html .Raw(MultiAutoCompleteRes.Index_Text2)</ p > } |