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
360
XamComboEditor: how to work with MultiSelect in a MVVM project (get selected items, set selected items)
posted

Hi all,

I´m using XamComboEditor (InfragisticsWPF4.Controls.Editors.XamComboEditor.v13.1) with multiselect enabled (AllowMultipleSelection="True") in my view.
In the view model I have a list of objects that is bound to the combo´s ItemsSource property. Displaying the items in the combo works fine and with "only" two days of work (I´m pretty new to WPF) and a lot of ugly code-behind I´m now able to get a collection of the selected items from the combo. Unfortunately I cannot bind something to the combo´s SelectedItems property, as I would expect. So this is really cumbersome but works at least somehow with code-behind.

I´m now get stuck with selecting items in the combo depending on changes in the collection of my view model. Even with code-behind I´m not able to set the combo´s SelectedItems property.

I´m not sure if I described my problem clear. What I want to do is:
- bind a multiselect enabled XamComboEditor to a collection of objects in the view model
- in the view model: get a collection of all items selected in the XamComboEditor (selected by the user)
- in the view: update selected items in the XamComboEditor depending on the items in (bound) collection (change in view should be triggered by adding/removing items to the bound collection in the view model).

Are there any examples or tutorials? I searched the web for hours but did not found anything useful.

Thanks in advance,
Daniel