views:

112

answers:

1

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?

+2  A: 

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).

Jeff Wilcox
I've got the MinimumPrefixLength set to 2, which is where I'd like to keep it if possible. Is there a way to create these visual elements after pulling in the list instead of waiting until the user starts to type? I tried adding two common characters to the Text property after the list was specified as the datasource, but it didn't help.
Traples