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!
It sounds like there is a disconnect with the binding scenario in your XAML or code. There can be several reasons for this happening. The Feature Browser shows a sample of how to get a XamComboEditor working in the XamDataGrid. However, oftentimes a particular required data model setup may make it difficult to copy how the Feature Browser implements a view. The fastest way to help us help you solve this is to submit a small sample application which shows the problem. If you can reproduce this in a sample, then I can look at the XAML and determine why you would have a ComboEditor that works and does not work between the two modes (edit mode and non-edit mode).
I'm having a very similar problem. I have manu xamcomboeditors in my grids and all work OK. they are usualy bound to a 2 column list where he ID column is int or guid. in this case, I have a simple list that has 2 elements - "N" and "S". To make things work in my framework which expects 2 columns, I made the ID column "S" and the ItemName column "S" for one element, and the same using "N" for the second element.
When the grid loads, all looks good. then the row goes into edit mode, all looks good. but when I click out of the row, the display text is the object name: "vComboDataTypes.ComboItemList". But if I go back to that cell and select an item from the list again "N" or "S". it works correctly from that point foreward. aarrrrr. Does anyone have any insite and a solution on this?