I have the following column defined in my xaml code
<telerik:GridViewMaskedTextBoxColumn Mask="P1" MaskType="Numeric"
DataMemberBinding="{Binding CurrentAllocationWeight}"
DisplayIndex="1" IsReadOnly="True" DataFormatString="{}{0:P1}"
Header="% Of Total" ColumnGroupName="CurrentAllocation"/>
The bound property is a null-able decimal value. I have no other validation in the code-behind. When I try to enter a value in the cell, I get a validation error: “DecimalConverter cannot convert from System.Double”.
How should I fix this, so that the user can enter say, 5.5, and it would display that value as “5.5%” in the cell?
Hasanain
The solution is to create a double to decimal value converter. In the value converter, ConvertBack method, simply cast the double to a decimal.