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
535
Selection over ValuePath on an UnboundFiled-XamComboEditor
posted

Hi there,

I’m having trouble to use a XamComboEditor in a XamDataGrid UnboundField.

I have a ViewModel which saves my possible ComboBox-selection in a unit-ObservableCollection, this selectable object has a Name, a UnitSymbol and a UnitId property.

On the other hand my XamDataGrid gets a collection of Parameters, where every object has an own instance of a unit. So for this reason I can’t use SelectedItem to preselect its own unit from my unit-Collection, because the object in the collection and in the Parameter is different, even with the same metadata. (btw. if every parameter-object gets his unit from my unit-collection everything is just fine, when I use SelectedItem)

So my problem is that I want to show my Parameter-unit with its UnitSymbol but I have to select it by its UnitId, to match it with my unit-collection.

If I try to use the ValuePath-Property I only get the object-name displayed.

Also every Parameter has some Child-Parameter with the same type.

BR

Andreas

WpfApplication1.zip
Parents
  • 138253
    Offline posted

    Hello Andreas,

     

    Thank you for your post. I have been looking into it and the sample you have uploaded and I can suggest you remove the ValuePath of the XamComboEditor, because the value of the UnbundField is ParameterUnit type and if you set the value path, it means that you are trying to set a String value to this type and exceptions are thrown in the Output. Please let me know if this helps you or you have further questions on this matter.

     

    Looking forward for your reply.

Reply Children