Hi,
I'm having a strange issue with using XamComboEditor outside a DataGrid. In my custom user control, I have three XamComboEditors, each has a list of rating objects as its ItemsSource.
The problem is when I bind the control to its initial rating selections, the rating texts are displaying fine in two of the XamComboEditors, but in one of XamComboEditor is displaying the Value rather than the rating text. If I try replacing the XamComboEditors by WPF ComboBoxes then all is showing correctly.
What is more confusing is in the problemetic XamComboEditor, when I select from the dropdown menu, it displays the rating text correctly for some of the items, even after the XamComboEditor lose its focus. But for some items it displays the rating text on selection, and shows the Value instead after the XamComboEditor lose its focus.
Here is my xaml:
<infEditor:XamComboEditor Name="cboLongTerm" Grid.Column="0" Grid.Row="3" Width="58" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,2,2,2" Foreground="Black" Value="{Binding Path=LongTermRatingID, Mode=TwoWay}"IsEnabled="{Binding Path=IsEnabled}"/>
<infEditor:XamComboEditor Name="cboOutlook" Grid.Column="1" Grid.Row="3" Width="58" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,2,2,2" Foreground="Black" Value="{Binding Path=OutlookRatingID, Mode=TwoWay}" IsEnabled="{Binding Path=IsEnabled}"/>
<infEditor:XamComboEditor Name="cboShortTerm" Grid.Column="2" Grid.Row="3" Width="58" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,2,2,2" Foreground="Black" Value="{Binding Path=ShortTermRatingID, Mode=TwoWay}" IsEnabled="{Binding Path=IsEnabled}"/>
and I'm setting the ItemSource in code:
public
cboLongTerm.ItemsSource = ltratings;
cboLongTerm.DisplayMemberPath =
"Rating";
cboLongTerm.ValuePath =
"AgencyRatingID";
cboShortTerm.ItemsSource = stratings;
cboShortTerm.DisplayMemberPath =
cboShortTerm.ValuePath =
cboOutlook.ItemsSource = outlooks;
cboOutlook.DisplayMemberPath =
"Name";
cboOutlook.ValuePath =
"Id";
Has anyone had a similar problem before?
Thanks,
Tess
I am currently diagnosing a similar problem, although with the ComboBox in a grid on an AddNewRecord row. When the combobox is selected, it is correctly using the Editor template. However, when the combobox loses focus, it's occasionally displaying the class name (eg. Business.Customer), probably via to ToString() call. If you shift focus back to the cell, and select a value and shift focus away again, it usually displays the correct "selected item" display member text.
I don't have a solution yet, but I am working with a similar problem.
Hello,
I apologize that this post was not answered sooner. We are making the effort to ensure all posts are addressed by an Infragistics expert.
Did you solve this issue? If not, is this something you could extract into a small WPF sample project? I would be happy to work through this issue with you to solve it.
Thank you!