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
60
Binding XamMultiColumnComboEditor value property to viewmodel
posted

I have a WPF XamMultiColumnComboEditor whose ItemsSource is bound to a view model property that returns List(Of ELReason). The object ELReason has multiple properties, and the dropdown elements in the combo display multiple columns.

The individual ELReason objects in the list have multiple properties, one of which is the DisplayMemberPath (Name) and one of which I would like to be the SelectedValuePath (Id).

Further, I would like two-way binding between this SelectedValue property (Id) and a property in my viewmodel object (ReasonId).

Since the XamMultiColumnComboEditor does not have a SelectedValuePath property, I followed an example on the forums to subclass XamMultiColumnComboEditor as a class called XamMultiColumnComboEditorEx. This subclass implements the SelectedValuePath property.

I also created a binding on the SelectedValue property to my viewmodel property (ReasonId). But I do not get any inital value selected, nor does the property set method get called when I change the selection in the combo.

I have a simple project attached that demonstrates the issue. I am using NetAdvantage 2012.1 for WPF.

Please let me know if I am doing something wrong or if you have any thoughts about how to do this properly.

Thanks

WpfApplication1.zip