Hi,
My question is similar to the question on this thread https://es.infragistics.com/community/forums/t/34846.aspx.
I studied the sample code sample download from the thread and applied it to my solution with changes to obsoleted segments and I cant get it to work. The comboboxes are not showing up. Please help.
Here is my code
<igDP:Field BindingType="UseAlternateBinding" AlternateBinding="{Binding Path=SelectedCity, Mode=TwoWay}" Label="{x:Static localization:ManagerParameters.ModificationLabel}" Visibility="Visible"> <igDP:Field.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsSource" Value="{Binding DataPresenter.DataContext.Cities}"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
Thanks,
Lala
Hello Lala,
Thank you for the code-snippet and the thread reference you have provided.
When the DataItem class (in our case MyClass) contains a child collection, this collection will be displayed as another child layout in the XamDataGrid by default. Since we would like to visualize the items of this collection within a XamComboEditor (instead of in another layout), we can manually disable the visibility of the corresponding field for the collection (the Cities field) and create a new ComboBoxField that is bound the the underlying Cities collection of every MyClass instance.
XAML:
<igDP:Field Name="Name" /> <!-- Displays with additional layout by default --><igDP:Field Name="Cities" Visibility="Collapsed" /> <igDP:ComboBoxField Label="Cities Combo" BindingType="Unbound"> <igDP:ComboBoxField.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsSource" Value="{Binding DataItem.Cities}"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:ComboBoxField.Settings></igDP:ComboBoxField>
<!-- Displays with additional layout by default --><igDP:Field Name="Cities" Visibility="Collapsed" />
<igDP:ComboBoxField Label="Cities Combo" BindingType="Unbound"> <igDP:ComboBoxField.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsSource" Value="{Binding DataItem.Cities}"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:ComboBoxField.Settings></igDP:ComboBoxField>
I have attached a sample application that demonstrates the approach from above.
If you have any questions, please let me know.
Thanks Tacho, I also need to the selected item of the combobox item.