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
1612
EditorWithMask - how to format string during entering
posted

I wonder what mask shall be set to format string during entering.

I have format string set to ###,###,##0

So numbers are displayed correctly when loosing focus from cell

I wonder if I can setup similar input mask allowing user to see thousands separator when he imputs numbers (eg if he is entering 123456, he will see 123,456 still beeing in edit mode)

My current input mask is nnnnnnnnn

 

 

  • 69832
    Offline posted

    Yes, just put the commas in the mask, i.e., set the MaskInput property to "nnn,nnn,nnn". I forget whether we interpret the comma character as a token for the current culture's thousands separator, but if we don't you can get that character from the culture's NumberFormat, and use that instead.