Hello,
We are binding a RadGridView to a property (Observable Collection of Entities) in an MVVM scenario. Within this grid we have a GridViewCheckBoxColumn that has a DataMemberBinding to a string property within our entities. Since the string is always "0" or "1" we use a ValueConverter to convert to Boolean - True/False in order to tick the checkbox. We found that the converter always calls the "Convert" method instead of the "ConvertBack" upon setting the value....
For test purposes we were binding a standard GridViewDataColumn to the same converter to ensure it is working properly which it does....
Example:
Now, when we change the value in the GridViewDataColumn the "ConvertBack" method is correctly (as expected) invoked....
When we do the same (ticking / unticking the checkbox on the GridViewCheckBoxColumn) it always calls the "Convert" method.....
Clearly that can't be right.... can you guys please help!
Many Thanks in advance.....
Regards
M.
We are binding a RadGridView to a property (Observable Collection of Entities) in an MVVM scenario. Within this grid we have a GridViewCheckBoxColumn that has a DataMemberBinding to a string property within our entities. Since the string is always "0" or "1" we use a ValueConverter to convert to Boolean - True/False in order to tick the checkbox. We found that the converter always calls the "Convert" method instead of the "ConvertBack" upon setting the value....
For test purposes we were binding a standard GridViewDataColumn to the same converter to ensure it is working properly which it does....
Example:
<Grid> |
<Grid.RowDefinitions> |
<RowDefinition Height="0.913*"/> |
</Grid.RowDefinitions> |
<Expander Grid.Row="1" |
Header="Berthing Slots" |
IsExpanded="True" |
VerticalAlignment="Top" Margin="0,4.988,0,0"> |
<telerik:RadGridView x:Name="radBerthingSlots" |
AutoGenerateColumns="False" |
IsEnabled="True" |
ItemsSource="{Binding BerthingSlots}" |
SelectedItem="{Binding SelectedBerthingSlot, Mode=TwoWay}" |
AddingNewDataItem="radBerthingSlots_AddingNewDataItem" |
RowEditEnded="radBerthingSlots_RowEditEnded" Deleting="radBerthingSlots_Deleting"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewCheckBoxColumn Header="Available" DataMemberBinding="{Binding Path=HtDiff, Converter={StaticResource HtDiffNumberConverter}, Mode=TwoWay}" /> |
<telerik:GridViewDataColumn Header="HT Diff" DataMemberBinding="{Binding Path=HtDiff, Converter={StaticResource HtDiffNumberConverter}, Mode=TwoWay}" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Grid> |
Now, when we change the value in the GridViewDataColumn the "ConvertBack" method is correctly (as expected) invoked....
When we do the same (ticking / unticking the checkbox on the GridViewCheckBoxColumn) it always calls the "Convert" method.....
Clearly that can't be right.... can you guys please help!
Many Thanks in advance.....
Regards
M.