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
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.
Hi Stefan,
Thank you for your response. It’s correct if I remove the ValuePath, the unit will be shown. But in this case the Value from my DataItem is not selected, only the first Item from my ItemSource.
In my case this means, if I remove the ValuePath the unit ‘m’ will be selected and not the unit ‘g’ from my Parameter.