Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
ComboBoxTool Selection Changed Issue
posted

Good day everyone,

I've faced a situation when I am getting extra handling (or raising) of the selection changed event of ComboBoxTool. I have one with enabled autocomplete, drop-down list style and I want to do some action after I select an item in the dropdown. To do this I am handling mentioned above event and do the action there. Unfortunately, this event is raised even during work of autocomplete when I am typing something trying to find an option in the dropdown => I am getting extra call of my action in the handler. Is there any workaround how can I get rid of this?

Thank you in advance, 

Maksim.

  • 12480
    Offline posted

    Hi Maksim,

    This is expected behavior. When using autocomplete, the combo box automatically selects the item as soon as the text is autocompleted. If you are looking for an event that fires when the user is "done" setting a value, I recommend using LostFocus. There is no way to tell when the user has decided that he's happy with the completed value, because they may choose to simply leave the control.

    If you instead want to force the user to make an explicit selection, my recommendation is to use the DropDownStyle property on the tool to DropDownList. The user will not be able to type in the combo, and you will be able to use the SelectionChanged event to definitively determine that the user has committed his or her choice.

    Please let me know if you have any further questions.