Hello,
I'm having problems using the xamComboEditor when items in the itemsSource have a DataTemplate for their Type. When Binding the xamCombo the list of Items is correctly rendered according to each Items DataTemplate.
However when the xamCombo loses focus then the text for the SelectedItem is refreshed and overwritten with the ToString of the SelectedItem object. With a normal WPF combobox there is no change when the control loses focus . How can I get the same behavior as a normal combobox. Below is a simple piece of code to reproduce the problem. Thanks, Christian
The XAML:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igRibbon="http://infragistics.com/Ribbon"
xmlns:local="clr-namespace:Ribbontest"
xmlns:s="clr-namespace:System;assembly=mscorlib"
x:Class="Ribbontest.Window12"
Title="Window12" Height="300" Width="300" xmlns:igWindows="http://infragistics.com/Windows">
<Window.Resources>
<local:ProductConverter x:Key="ProductConverter" />
<DataTemplate DataType="{x:Type local:Product}">
<TextBlock Text="xxx" />
</DataTemplate>
<ObjectDataProvider x:Key="provider"/>
</Window.Resources>
<StackPanel>
<igRibbon:ComboEditorTool
Id="productsCombo"
x:Name="productsCombo"
IsEditable="False" ItemsSource="{Binding Items}">
</igRibbon:ComboEditorTool>
<ComboBox x:Name="productsCombo2" ItemsSource="{Binding Items}"/>
<TextBox Text=" "/>
</Window>
The Code Behind:
{
/// <summary>
/// Interaction logic for Window12.xaml
/// </summary>
public partial class Window12 : Window
InitializeComponent();
Items.Add(new Product(1, "aaa"));
}
Hi,
That seems to be a bug in XamComboEditor. If you report the issue to our Developer Support group, they will be sure that you are sent a notification when the issue has been resolved. Sorry for the inconvenience.
Thanks,Josh
Any indication that this has been fixed??? - it was 12 months ago!
I've got the following:
<igEditors:XamComboEditor x:Name="cbPerson" DisplayMemberPath="Name" ValueType="{x:Type local:Person}" Value="{Binding Source={x:Static local:Window1.SelectedPerson}, Path=Name, Mode=OneWay}"> <igEditors:XamComboEditor.ItemsSource> <CompositeCollection> <CollectionContainer Collection="{Binding Source={x:Static local:Window1.StandingData}, Mode=OneWay}" /> </CompositeCollection> </igEditors:XamComboEditor.ItemsSource> </igEditors:XamComboEditor>
but when the 'Window1.SelectedPerson doesn't exist in the Window1.StandingData list it seems to be calling ToString() on the SelectedPerson object rather than using the DisplayMemberPath as indicated.
I don't really want to implement ToString on all my classes in this way.
Can you suggest a course of action?