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
150
XamMultiColumnComboEditor MultipleSelection and Two way Binding
posted

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://es.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.

XamComboEditorBehavior.zip
Parents
  • 138253
    Offline posted

    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.

    XamComboEditorBehavior.zip
Reply Children