I'm creating a combo with:
<igEditors:XamComboEditor Grid.Column="1" Grid.Row="1" Name="xamCombo1" > <igEditors:XamComboEditor.ItemsProvider> <igEditors:ComboBoxItemsProvider /> </igEditors:XamComboEditor.ItemsProvider></igEditors:XamComboEditor>
And then trying to bind it to a data table with two columns thusly:
xamCombo1.ItemsProvider.ItemsSource = dataTable.DefaultView;xamCombo1.DisplayMemberPath = "column1";xamCombo1.ValuePath = "column2";
When I run it, the combo drops down but all it says is "System.Data.DataRowView" for each item and when I select one, that's what I get in the textbox portion of the combo. I'm obviously seeing the ToString() function of each dataRow. How do I get the actual data to appear?
You can either set the DisplayMemberPath and ValuePath on the ItemsProvider itself or instead of setting the ItemsProvider property, you could set the ItemsSource property directly to the dataTable.DefaultView (just make sure you don't set the ItemsProvider property then).
Hi,
I have a similar problem:
I set ItemsSource, DisplayMemberPath and ValuePath all on ItemsProvider, however, the dropdown shows only System.Data.DataRowView for each item, but when I select one item, I do see correct value displayed. I use the combobox editor in grid.
Here is digested from my code:
in XAML
<igEditors:ComboBoxItemsProvider x:Key="notificationTypesProvider" DisplayMemberPath="desc" ValuePath="code"> </igEditors:ComboBoxItemsProvider>
...
<igDP:Field Name="notificationType" Label="type" Width="100"> <igDP:Field.Settings> <igDP:FieldSettings> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type ComboEditor:XamComboEditor}"> <Setter Property="ItemsProvider" Value="{StaticResource notificationTypesProvider}" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
in the code, i set ItemsProvider.ItemsSource
Please suggest,
Thanks!
Yu