Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1715
Editing percentages in XamDataGrid
posted

I have a data object with a property that I would like to display and edit as a percentage. I have not been able to get this to work.

<Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="ValueConstraint"> <Setter.Value> <igEditors:ValueConstraint MinInclusive="-100" MaxInclusive="100" /> </Setter.Value> </Setter> <Setter Property="Format" Value="P2" /> <Setter Property="Mask" Value="-nnnnnnnnnn.nn %" /> <Setter Property="NullText" Value="-" /> </Style>

If the value of my property is, 0.3333, this style allows my Numeric editor to display "33.33%" in the grid, but when I try to edit, it displays "0.33 %". It appears that the numeric formatting string P2 gets interpreted correctly, whereas, there is no way to tell the editor that the value of the property should be multiplied by 100.0 before displaying. How can I display/edit percentages in the XamDataGrid?