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
4155
XamComboEditor Multiple Selection Bug
posted

Hello,

I have found an issue with the XamComboEditor when Multiple Selection is enabled.

If the user presses the enter key to select an item that was already selected or types the items name twice an exception is thrown that cannot be handled because it originates from external code via "InfragisticsWPF4.Controls.Editors.XamComboEditor.v15.2".  The exception messages is "Cannot select the same item multiple times." which makes sense but I cannot handle the exception.

I tried to bypass the exception by handling the PreviewKeyDown event for the combo editor and set the event's handled property to true if the currently selected item already has the IsSelected flag set to true.  This works for the user navigating to the item via the arrow keys, however the exception is thrown before the PreviewKeyDown event fires when the user types in the same item name twice.  I would like to bypass or handle this exception silently if possible so that either I can prevent the item from being selected twice or simply use a distinct list from the results.

See attached sample project for the error and my attempts to fix this.

Thanks,

Phillip

ComboEditorEnterKeySelection.zip