문제

I'm using wpf toolkit AutoCompleteBox control and I want it to display only 5 results, How can I set this ?

I've noticed that there's a Property called "MaxDropDownHeight" but it doesn't help since more than 5 results are displayed but with scrollbar.

도움이 되었습니까?

해결책

Set your ItemFilter to a delegate of type...

public AutoCompleteFilterPredicate<Object> ItemFilter { get; set; }

...doing this will also default the FilterMode to Custom. An example is located on the MSDN site.

Once you have the base functionality implemented you will need to keep a class level count so that you can return N values since the filter will be called once for each item.

Thus by setting your class level count to 5; once you hit the 6 you could return false within your filter code.

In addition you will need to know when the search criteria has changed so you can begin the filtering process from 0.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top