Is it possible to open AutoCompleteBox when its TextBox GotFocus? #19355
-
I was trying using Style pseudoclass AutoCompleteBox:focus and set property IsDropDownOpen and set it throught GotFocus event. But it does not work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The autocompletebox is a tricky beast, you can use behaviours to do what you want (there are some private methods and properties you can only access through reflection). This example will automatically display the dropdown on focus if the autocompletebox does not have a value set. An alternative to using a behaviour is to set MinimumPrefixLength="0" on the autocompletebox so that your users can press the down arrow or F4 to display the list. |
Beta Was this translation helpful? Give feedback.
The autocompletebox is a tricky beast, you can use behaviours to do what you want (there are some private methods and properties you can only access through reflection).
This example will automatically display the dropdown on focus if the autocompletebox does not have a value set.
TestAutoCompleteBehaviour.zip
An alternative to using a behaviour is to set MinimumPrefixLength="0" on the autocompletebox so that your users can press the down arrow or F4 to display the list.