AutoComplete Match Style

By default, the AutoComplete control highlights matches by applying the wj-autocomplete-match class to matching spans in the drop-down list. C1 MVC's css defines a rule that makes those elements bold.

If you want to use a different style to highlight matches, use CSS to customize the rules applied to the wj-autocomplete-match class:

1
2
3
4
5
// This file locates: "Content/css/Lesson/C1Input/AutoCompleteSearching.css".
.wj-autocomplete-match {
  border: 1px solid green;
  background: #e0ffe0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
using System.Web.Mvc;
 
namespace LearnMvcClient.Controllers
{
    public partial class C1InputController : Controller
    {
        // GET: AutoCompleteSearching
        public ActionResult AutoCompleteSearching()
        {
            return View(Models.Gdp.GetData());
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@model IEnumerable<Gdp>
 
<h1>
    @Html.Raw(Resources.C1Input.AutoCompleteSearching_Title)
</h1>
 
<p>
    @Html.Raw(Resources.C1Input.AutoCompleteSearching_Text1)
</p>
<p>
    @Html.Raw(Resources.C1Input.AutoCompleteSearching_Text2)
</p>
<label for="theAutoComplete">@Html.Raw(Resources.C1Input.AutoCompleteSearching_Text3)</label>
@(Html.C1().AutoComplete<Gdp>().Id("theAutoComplete").Bind(Model).DisplayMemberPath("Country"))