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
120
Setting a mask in XamNumericEditor that does not show trailing zeros
posted

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

Parents
  • 3520
    Verified Answer
    Offline posted

    Hello Marek,

     

    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.

    DataGrid_NumericEditor.zip
Reply Children