Matt

Matt

  • NA
  • 2
  • 4.6k

Highlight feature not working with Ajax AutoCompleteExtender

May 17 2012 10:53 AM

Hello,

Currently using Visual Studio 2008, and am trying to incorporate an AutoCompleteExtender.

I had followed this tutorial here: http://www.codeproject.com/Articles/201099/AutoComplete-With-DataBase-and-AjaxControlToolkit

Instead of setting up a database, to test, I just commented out some of the stuff in the webservice (GetCompletionList) and put this:

        [WebMethod] public string[] GetCompletionList(string prefixText, int count)
       
{
           
List<string> txtItems = new List<string>();
            txtItems
.Add("mattr1");
            txtItems
.Add("mattr2");
            txtItems
.Add("mattr4");
            txtItems
.Add("mattr5");
            txtItems
.Add("helloworld1");
            txtItems
.Add("helloworld2");
            txtItems
.Add("helloworld4");
            txtItems
.Add("helloworld5");
            txtItems
.Add("unique");
            txtItems
.Add("newlist");

           
return txtItems.ToArray();
       
}

Everything works perfect, except that the highlighting does not work. I have tried several different CSS styles I found to change the appearance (such as the "CompletionListHighlightedItemCssClass" field for the control). I even tried everything completely simple and just change the background, still nothing. I then tried it by just removing the css all together and still nothing.

It does however work if I press the "down arrow key" on the keyboard then the highlighting shows up and I can move it up or down, but if I'm typing, nothing gets highlighted.

Is there something I'm doing wrong? Do I have too old a version of this or something? Any help is greatly appreciated, thanks!

-Matt