I need this WPF ComboBox as a dropdown where user cannot enter text like textbox but still be able to search via typing text.
I set IsEditable = false and IsTextSearchEnabled = true and it works.
But the problem is that lets say a user is searching for text “Japan”. User start text input into the combo with “J”. Some items starting with “J” appear in the filtered list of the drop down panel. Now if user waits for 3-4 seconds and then types “a” (to complete typing “Japan”), the filtered list will rather move to items starting with “a”.
It should rather search for “Ja” but it searches for “a” and discards “J”.
Any ideas how do I fix this behavior?
In short, I don’t think you can (easily). See this post:
WPF combobox search item
What it boils down to is that internally
ComboBoxis using a built-in class calledTextSearch. In this class the timeout interval is hard-coded and is not publicly accessible, so you can not change this behaviour.However, you might have some luck by implementing your own control that inherits from
ComboBoxand provides an override of the protected membersOnTextInputandOnKeyDown. In here, you could implement your own searching logic and own timeout (which could be exposed as aDependencyPropertyand hence configurable from within XAML).