Hello.I have created a XamMultiColumnComboEditor with multiple selection based on a behavior. The behavior works perfectly fine, but I need to select elements programmatically from the ViewModel. I read an article written by Devin Rader who says 'The XamComboEditorSelectedItemsBehavior supports two-way binding, so changes to the SelectedCustomers collection exposed by the ViewModel will be reflected by the XamComboEditor.'.
http://ko.infragistics.com/community/blogs/devin_rader/archive/2011/06/01/using-behaviors-to-synchronize-selected-items-of-infragistics-silverlight-controls-to-a-viewmodel.aspx
In TwoWay binding scenario my application doesn’t work as I expected. I attach a simple application, to reproduce the issue easily.The problem is that when I select first element on the list and try to select the last one programmatically (click the button), both of them are selected.But when I first push the button that adds the last element in ViewModel, no elements are selected.Any help will be appreciated.
Hello Luk,
Thank you for your post. I have been looking into it and the sample you have provided and I modified it, so now it works as you want. Basically I changed the way the collection changed events are handled, because the SelectedPeople collection is initialized lately and the SelectedItems’ CollectionChanged event wasn’t handled. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hello.
No, it still doesn’t work.
The case is that if I push the button (it adds the element to the collection in the code behind), I won't appear as selected one.
You have attached the application without any modifications.
I'm looking forward for your reply.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
The solution works perfectly fine.
Thank you so much for your help.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Hello,
I am usign this beheviour and I run accros a problem with loding items.
I am loading and setting the ItemsSource then SelectedItems. The display shows correct items but when I open the dropdown Selected Items I do not have a CheckBox selected. Can I set/reload the SelectectedItems using MVVM?
Hi,
I am too having the same issue. You got any solution for this?