I have a form with a RadGrid control that has its ItemSource set to a collection in my View Model, and it all works
I need to add a GridViewComboBoxColum to the Grid. The source will be another collection in the same View Model.
Sounds simple, right? But I can’t get the ComboBox to appear.
For the examples below:
_vm is a public window variable that is a reference to my View Model.
valuestatus is the collection of values that I want to display in the dropdown.
WL_Dashboard is the class type of the list that is set in theitem source of the grid.
<telerik:GridViewComboBoxColumn Name="ValStatusColumn" Header="Val.Status"
SelectedValueMemberPath="{Binding Path=ValidationStatus, Mode=TwoWay}"
IsReadOnly="False"
HeaderCellStyle="{StaticResource BlueHeaderCellStyle}"
ItemsSource="{Binding _vm.valuestatus}"
DisplayMemberPath="valstatus">
</telerik:GridViewComboBoxColumn>
This does not generate an exception or an error in the output window – but the dropdown does not display
If I replace ItemsSource with ItemSourceBinding:
it generates a bunch of errors in the output window and the dropdown does not display:
System.Windows.Data Error: 40 : BindingExpression path error: '_vm' property not found on 'object' ''WL_Dashboard' (HashCode=55939488)'. BindingExpression:Path=_vm._valuestatus; DataItem='WL_Dashboard' (HashCode=55939488); target element is 'RadComboBox' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')
The documentation doesn't help me much because there is no itemsSource set on the grid. It sounds like if use ItemSourceBinding that I need to override the WL_Dashboard setting on the grid for this column - but how?
Any idea what I'm doing wrong? Gotta be something simple that I'm missing here...
Thanks in advance for any assistance you can provide.
Lou