I'm having an issue with the combo box. I have an event handler for OnClick
which refreshes data based on what item was selected. The problem is when this scenario occurs:
- Drop-down the combo box to list the various options
- Type on the keyboard to find a matching item
- Combo box changes this selection and calls the
OnClick
event - My screen refreshes due to this selection / event
- Click somewhere outside of the combo box to take the focus away from it
- Combo box goes back to the previous selection, even though
OnClick
was already called - Even though Combo box changed back to prior selection,
OnClick
isn't called again - After this, Combo Box shows different value than what my data actually represents
So when you open a combo box, and type a few letters on the keyboard to find the item in the drop-down list, OnClick
is fired which refreshes my screen. But when you click somewhere outside the combo box (thus taking the focus away from it), the combo box changes back to whatever value was previously selected, instead of what I had typed. And at the same time, the OnClick
event isn't fired, so the combo box shows the incorrect value compared to what I had loaded on the screen.
How do I make the combo box stay on the selected item in this scenario of typing the item on the keyboard?
DroppedDown
and if it is dropped down not refreshing the screen would work? – Sertac Akyuz