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
1700
Improve ValueConstraint and mask
posted

Hello,

I have a maskedInput with dynamic ValueConstraint. My actual mask is : "nnnnn.nnn"

I bind Max and Min value to properties in my ViewModel.

I have smoe questions :

-How to remove unwanted 0 when the maxValue is 1. Because it's display 1.000

It occurs when the value is not a decimal, the mask add some 0 after

-Display 0.x is my range is 0 to 0.9 and not .2 for example.

Could you help me to achieve these requirements ?

Regards

  • 34510
    Suggested Answer
    Offline posted

    Hi teamtim,

    The masked input control has a Format property.  Set this to "G".  Also make sure that the ValueType on the masked input matches the type you are binding to.  This should take care of your requirements.