version : 2013.2.611.1050
I can't seem to get GridViewComboBoxColumn set up in a way to make this simple scenario to work correctly.
If I set it up so that the selected value displays correctly in view mode, then a validation error shows -> "Input is not in correct Format"
If I set it up so the validation works correctly, then the selected Value will not display.
My DataModel
MainItem :Entity
Guid MainItemId
Guid UnitTypeId
dms_UnitType dms_UnitType (entity sets up this funny naming by default)
dms_UnitType : Entity
Guid UnitTypeId
String Name
The Grid Contains a List of MainItem. The unit type ItemSource is a List<dms_UnitType> exposed from the viewModel.
If not in a grid, my combo box would look like this:
<telerik:RadComboBox ItemsSource="{Binding UnitTypes}"
DisplayMemberPath="Name"
SelectedItem="{Binding dms_UnitType, Mode=TwoWay}" />
Translated into a GridViewComboBoxColumn I believe it should look like this:
<telerik:GridViewComboBoxColumn Header="Unit Type"
DataMemberBinding="{Binding dms_UnitType, Mode=TwoWay}"
ItemsSource="{Binding UnitTypes}"
DisplayMemberPath="Name"
SelectedValueMemberPath="Name" />
When set like this the selected value displays correctly in view mode, but I get a validation error "Input is not in correct Format". It looks like its trying to assign the SelectedValueMemberPath to my databinding, using a converter. My DataBinding wants the entire object selected from the list to be assigned, not the displayed value. Without SelectedValueMemberPath the Selected value does not display correctly in view mode.
To fix the validation I set it to select the Item's ID instead of the item itself:
<telerik:GridViewComboBoxColumn Header="Unit Type"
DataMemberBinding="{Binding UnitTypeId, Mode=TwoWay}"
ItemsSource="{Binding UnitTypes}"
DisplayMemberPath="Name"
SelectedValueMemberPath="UnitTypeId" />
When set like this the validation works correctly, but once again the selected value will not show once you exit edit mode.
I can't seem to get this simple scenario to work correctly. Any help would be greatly appreciated.
I can't seem to get GridViewComboBoxColumn set up in a way to make this simple scenario to work correctly.
If I set it up so that the selected value displays correctly in view mode, then a validation error shows -> "Input is not in correct Format"
If I set it up so the validation works correctly, then the selected Value will not display.
My DataModel
MainItem :Entity
Guid MainItemId
Guid UnitTypeId
dms_UnitType dms_UnitType (entity sets up this funny naming by default)
dms_UnitType : Entity
Guid UnitTypeId
String Name
The Grid Contains a List of MainItem. The unit type ItemSource is a List<dms_UnitType> exposed from the viewModel.
If not in a grid, my combo box would look like this:
<telerik:RadComboBox ItemsSource="{Binding UnitTypes}"
DisplayMemberPath="Name"
SelectedItem="{Binding dms_UnitType, Mode=TwoWay}" />
Translated into a GridViewComboBoxColumn I believe it should look like this:
<telerik:GridViewComboBoxColumn Header="Unit Type"
DataMemberBinding="{Binding dms_UnitType, Mode=TwoWay}"
ItemsSource="{Binding UnitTypes}"
DisplayMemberPath="Name"
SelectedValueMemberPath="Name" />
When set like this the selected value displays correctly in view mode, but I get a validation error "Input is not in correct Format". It looks like its trying to assign the SelectedValueMemberPath to my databinding, using a converter. My DataBinding wants the entire object selected from the list to be assigned, not the displayed value. Without SelectedValueMemberPath the Selected value does not display correctly in view mode.
To fix the validation I set it to select the Item's ID instead of the item itself:
<telerik:GridViewComboBoxColumn Header="Unit Type"
DataMemberBinding="{Binding UnitTypeId, Mode=TwoWay}"
ItemsSource="{Binding UnitTypes}"
DisplayMemberPath="Name"
SelectedValueMemberPath="UnitTypeId" />
When set like this the validation works correctly, but once again the selected value will not show once you exit edit mode.
I can't seem to get this simple scenario to work correctly. Any help would be greatly appreciated.