views:

102

answers:

1

I have a Silverlight Autocompletebox to show a list of staff members, and it is working great. I get the data by loading a BusinessObjects list.

My problem is that the very first time you start typing something in the box, it takes close to 2 seconds to come back with suggestions. Afterwards, any subsequent searches seem almost instantaneous.

Obviously there must be some sort of lazy-loading happening here, it must somehow be configured to trigger on the initial use of the control.

I would like to somehow load the data when the control is first loaded, it would make for a better user experience if even on the first typing that the suggestions seem instant.

Does anyone know how I can do this?

+1  A: 

Ok, after going back and forth on the Silverlight forum, got a great workaround that I though I would share. It was provided by a friendly Aussie named Matt, thought I would post it up here if people were curious.

Basically but setting the minimum search length to 2, you greatly reduce the processing and having the rendering "catch up" on the second and third characters. The other two attributes he suggests also help in speeding up the return.

Here is his post:

I updated my test project with your code and a much larger collection of items (100,000), and I started to see the issue ... :)

Setting the MinimumPrefixLength to 2 (or any value greater than 1. by default it is set to 1) and the MinimumPopulateDelay to 200 (by default it is set to 0) removed the issue for me. I'd also recommend setting the MaxDropDownHeight, as this will ensure virtualization in the AutoCompleteBox will function correctly.

uxAuto.MinimumPrefixLength = 2;
uxAuto.MinimumPopulateDelay = 200;
uxAuto.MaxDropDownHeight = 300;

Can you try this in your implementation and let me know how it goes? ...

Thanks. matt. Matthew Olney Senior Consultant - User Experience Avanade Australia

Mark Kadlec
Thank you very much!. Though I did not ask the question, I had the same problem which is now solved :D
frenetisch applaudierend
Good stuff! Thanks go out to Matthew Olney down in Australia though. :)
Mark Kadlec