I find sometime xamComboEditor has different items number between ItemsSource and Items. I can't provider the data which I bind to ItemsSource. The scenario is I bind 4 item to ItemsSource but the Items only has one empty item. When I set SelectIndex as 2, it crash. I use 11.2 version.
xaml code is:
<ig:XamComboEditor Name="PropertyUnitComboBox" Width="70" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=local:AFAMPropertyParameterControl},Path= PropertyUnits}" DisplayMemberPath="Name" Margin="10,0,0,0" IsEditable="True" AllowMultipleSelection="False" />
PropertyUnits is:
public IEnumerable PropertyUnits { get { return (IEnumerable)GetValue(PropertyUnitsProperty); } set { SetValue(PropertyUnitsProperty, value); } } public static readonly DependencyProperty PropertyUnitsProperty = DependencyProperty.Register("PropertyUnits", typeof(IEnumerable), typeof(AFAMPropertyParameterControl), new UIPropertyMetadata(null));
Hello,
I have been looking into your issue and we provide two XamComboEditors controls in our NetAdvantage product for WPF : WPF Specific XamComboEditor and shared XamComboEditor. WPF Specific XamComboEditor is similar to the Microsoft ComboBox control as the big difference between them is the way in which you bind data to the control. The shared XamComboEditor is not an ItemControl and you cannot add items directly in XAML. It must be strictly bound to data. It is not extended version of the WPF Specific XamComboEditor.
For more information about them I can suggest you look through the following links from our online documentation :
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamComboEditor.html
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=DP_xamComboEditor.html
In your sample project you have added the .ddl files for the both controls. When I remove the files for the shared XamComboEditor, it seems that everything goes as expected and all items appears.
I am sending you a modified version of your project.
If you have any other questions on this matter, feel free to ask.
I want to use the shared XamComboEditor. What does 'the strictly bound to data' mean?
Is following code a way of 'strictly bound to data':
xamComboEditor1.ItemsSource = Methods;
I find similar code in the 'Feature Browser'. Could you use shared XamComboEditor in my sample?
BTW, I didn't get reply mail when you answer my question. Could you check your email system? Thanks
‘Strictly bound to data’ means that you cannot add items directly in XAML. The provided code demonstrates exactly what I have in mind.
If you need any further assistance on this matter, feel free to ask.
I think your sample use wpf XamComboEditor, but I want to use shared XamComboEditor the one showed in 'Feature Browser'.
In 'Feature Browser', the xamComboEditor is in the namespace 'http://schemas.infragistics.com/xaml'.
You need not to change the xamComboEditor in my original sample. Could you check it again?
Share XamCobmoEditor is designed to be bound to object data and it is not suitable to work with primitive data types. In your case I can suggest you use wpf XamComboEditor control.