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
1385
Enter key in XamMultiSelectionComboEditor loses selections
posted

I am using the code provided by Krasimir found here:

https://ko.infragistics.com/community/forums/f/ultimate-ui-for-wpf/86076/multiselect-combobox-in-xamdatagrid-issue

With it I have a XamDataGrid where a column contains a XamMultiSelectionComboEditor where users can select multiple options from the list.  It works really well except that if a user selects options and uses the Enter key to accept and close (instead of clicking outside to lose focus), the selections are lost.

I have found that in OnEditModeEnding, the combo.SelectedItems is not updated with the selections and so while it is trying to save, the options aren't there to do it.

Can anyone suggest a fix?  I am using 18.2.

Parents
No Data
Reply
  • 34810
    Verified Answer
    Offline posted

    Hello Walter,

    When I am running Krasimir’s latest sample from the other post, I am unable to have any values stay in the multi-select combo editors. As such, I am going to recommend an alternate sample project, as it appears the post you have linked is also over 5 years old, and I have more recently written a sample that handles this behavior in a better way.

    In the sample I am attaching, there is a converter that converts the SelectedItems collection from a string on the underlying data item to an object[] that the XamComboEditor can work with. There is also an attached behavior on the XamComboEditor that, on SelectionChanged converts the SelectedItems to the string property on the underlying data item. This may seem like overkill, but in my experience with the XamDataGrid, one thing it does not play well with is multi-select combo editors, and this converter/behavior method allows it to work without removing selected values, even when scrolling.

    I hope the sample project helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew Goldenbaum
    Software Developer

    XDGMultiSelectDropDownCase.zip

Children