Hello
Is there a setting for the Mask property that would not show trailing zeros while editing? For instance, I have a couple of numbers of type System.Single displayed in the grid:10.43 and 10.425127
I'd like them displayed as above while editing but not like this:10.4300000 and 10.4251270
Combinations of #, 9 and n don't produce the desired effect at all times. Either trailing zeros appear or the extra fractional digits can not be typed in or the edited value is rounded.
I have the 2015.2 release.
Regards
Marek
Hello Marek,
Thank you for your feedback and sharing your solution. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Please do not hesitate to let me know if you require any further assistance on this matter.
Hi Galina
Thank for that! Adding the TrimFractionalZeros property helped. To get rid of the many "_" mask characters the code looks like this:
Dim padChar As Char = CChar(String.Empty)
style.Setters.Add(New Setter(XamNumericEditor.PadCharProperty, padChar))style.Setters.Add(New Setter(XamNumericEditor.PromptCharProperty, padChar))style.Setters.Add(New Setter(XamNumericEditor.TrimFractionalZerosProperty, True))style.Setters.Add(New Setter(XamNumericEditor.MaskProperty, "{double:15.7}"))
I have been looking into your requirements and I believe what you need to achieve the desired behavior is setting the XamNumericEditor's "TrimFractionalZeros" property to "True". It specifies whether to trim insignificant zeros in fraction part of numeric masks and by default is set to "False".
I am attaching a small sample application for your reference where this approach has been used.
If I misunderstood your requirements or you need further assistance on the matter, please do not hesitate to let me know.