Hello,
I have the following code -
<igEditors:XamComboEditor ItemsSource="{Binding Instances}" Margin="5,2,5,2" Width="175" HorizontalAlignment="Left" SelectedItem="{Binding SelectedInstance,Mode=TwoWay,NotifyOnValidationError=True,ValidatesOnDataErrors=True,ValidatesOnExceptions=True}" > <igEditors:XamComboEditor.ComboBoxStyle> <Style TargetType="ComboBox"> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <TextBlock> <TextBlock.Text> <MultiBinding StringFormat="{}{0} ({1})"> <Binding Path="Name" /> <Binding Path="Id" /> </MultiBinding> </TextBlock.Text> </TextBlock> </DataTemplate> </Setter.Value> </Setter> </Style> </igEditors:XamComboEditor.ComboBoxStyle> </igEditors:XamComboEditor>
When I set the SelectedInstance from my viewmodel, the combobox is displaying the type of the object. If I then make a selection, it displays correctly, but I click out of the combobox, losing focus, it reverts back to the object type. If I set the DisplayMemberPath manually to just Name, it works correctly, but I really need it to be a concatenated value for the displaymemberpath.
Can anyone help?
Thanks
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I used the XamComboEditor’s ValueToDisplayConverter in order to convert the value that will display when not in edit mode. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
That solution worked perfectly - thanks for the help.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.