Search code examples
silverlightsilverlight-3.0autocompletedelay

Silverlight AutoCompleteBox takes a long time to respond on first "search"


I have a Silverlight application which loads about 2000 objects of half a dozen fields into an AutoCompleteBox. The filter is then set to search on any of four of the fields. I've set it to begin searching after two characters.

However, when I type the second character (when the box is supposed to start populating) for the very first time after populating the List of objects, the AutoCompleteBox takes about 6-7 seconds to respond.

Any ideas on how I can optimize this?

Is there a way to create these visual elements right after the list is populated instead of waiting for the user to begin typing?


Solution

  • Have you alreay adjusted the MinimumPrefixLength propery? The more characters you require, the filtering will be better.

    Right now, with a low prefix, you have 2000+ visual elements that are created, minus say one character of filtering, regardless of any other optimizations.

    Another option is to implement your own background thread-filtering, but that defeats many of the purposes for the control (i.e. simplicity).