title: Autocompleting combobox in ASP.NET MVC?
body: <p>I'm trying to convert an app that I had previously written in ASP.NET Web Forms to MVC and am stuck on the problem of implementing an autocompleting combobox. Previously, I had used Telerik's RadComboBox, but I'm not sure how to make this work in MVC or if it even can be made to work. Here's the markup code I was using:</p>
  
  <pre><code>&lt;telerik:RadComboBox ID="Brand" runat="server" Width="250px" EmptyMessage="Choose a brand" EnableLoadOnDemand="true" OnItemsRequested="Brand_OnItemsRequested" /&gt;
  </code></pre>
  
  <p>And the code-behind:</p>
  
  <pre><code>protected void Brand_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
  {
    foreach (BrandCode b in _repository.GetBrandCode(e.Text).OrderBy(b =&gt; b.BrandName).Take(10))
    {
      Brand.Items.Add(new Telerik.Web.UI.RadComboBoxItem(b.BrandName, b.BrandCode1));
    }
  
    Brand.DataBind();
  }
  </code></pre>
  
  <p>Any ideas appreciated.</p>