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,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
I must had send you the wrong archive, I apologize for this. Here I attached the modified sample. 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.
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.