Is it possible to bind the ItemsSource of the ComboBoxItemsProvider to an ObjectDataProvider? I was under the impression that with normal ComboBoxes and other ItemsControls this was possible. Is there something different about the ComboBoxItemsProvider that doesn't allow this? I get this error when I try:
Cannot convert the value in attribute 'ItemsSource' to object of type 'System.Collections.IEnumerable'. 'System.Windows.Data.ObjectDataProvider' is not a valid value for property 'ItemsSource'.
This works fine with a normal ComboBox.
Here's a snippet of my XAML:
<UserControl.Resources>... <ObjectDataProvider ObjectType="{x:Type bll:LocationManager}" x:Key="locationProvider" MethodName="GetLocations"> <ObjectDataProvider.MethodParameters> <s:Int32>1</s:Int32> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> <igEditors:ComboBoxItemsProvider x:Key="locationItemsProvider" ItemsSource="{StaticResource locationProvider}" ValuePath="LocationID" DisplayMemberPath="LocationDesc" > </igEditors:ComboBoxItemsProvider></UserControl.Resources>
GetLocations returns a List.
And of course further down in the XAML my XamComboBox binds to the ItemsProvider. Any help would be appreciated!
Thanks!
My initial look at your XAML, I would think you would need to assign the ItemsSource using the Binding syntax, such as:
ItemsSource
I will check with an engineer to see what insights he may have about this issue and post his response.
Thank you,
It looks like the problem may have been the binding syntax in your code. Here is the code and XAML for my sample which illustrates how to bind to the XamComboEditor using a ObjectDataProvider:
XAML
<
C#