This question is locked. New answers and comments are not allowed.
We would like the dropdown to automatically open for our comboboxes.
I have already looked into OpenDropdownOnFocus, but that behavior is not satisfactory for our project. We need dropdown on keyboard input specifically.
I managed to get it to work by overriding the OnKeyDown as below, but there is a problem. The filtering doesn't work the first time you open the combobox in this manner. Every subsequent time, it works, just the first time is a problem. I suspect that you are lazily loading the items for the dropdown and that is causing the filtering to not function, which is good for efficiency but we really need this behavior for our app.
We are binding to a simple collection so i wouldn't expect the delay of loading items to be very long.
Do you have any suggestions to work around this problem? Is there an event we can listen to for when the items are loaded where we can trigger it to filter again?
I have already looked into OpenDropdownOnFocus, but that behavior is not satisfactory for our project. We need dropdown on keyboard input specifically.
I managed to get it to work by overriding the OnKeyDown as below, but there is a problem. The filtering doesn't work the first time you open the combobox in this manner. Every subsequent time, it works, just the first time is a problem. I suspect that you are lazily loading the items for the dropdown and that is causing the filtering to not function, which is good for efficiency but we really need this behavior for our app.
We are binding to a simple collection so i wouldn't expect the delay of loading items to be very long.
Do you have any suggestions to work around this problem? Is there an event we can listen to for when the items are loaded where we can trigger it to filter again?
protected
override
void
OnKeyDown(KeyEventArgs e)
{
if
(!IsDropDownOpen && LettersAndNumbers.Contains(e.Key))
{
IsDropDownOpen =
true
;
}
base
.OnKeyDown(e);
}