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
115
MaskInput using double format raises exception in German
posted

Hello.  I have just started working on adding German translations into our application.  And I've already found one instance of a MaskInput value that works fine in English (en-US) but causes an exception in German (de-DE).  We do localize the literal text in the mask, which could be at least part of the problem.  Also the NumericType of the control is set to Double.

In English, we set:

myNumericEditor.FormatString = "##.## deg";

myNumericEditor.MaskInput = "{double:-2.1} deg";

 

In German, we set:

myNumericEditor.FormatString = "##.## Grad";

myNumericEditor.MaskInput = "{double:-2.1} Grad";

 

The mask works fine in English.  But in German, I get the exception message:

"The specified mask is not compatible with the current value of the 'NumericType' property."

 

Somehow it seems like it can parse the MaskInput and know that the literal characters are just literal characters when running our application in English.  But when I run our application in German, it seems like it doesn't expect to find literal text at the end of the mask string.  I tried inserting "{LOC}" at the start of the MaskInput string, based on some other forum posts, but that did not help at all.  I would appreciate any suggestions on how to fix this.  Thanks.

Parents
  • 69832
    Offline posted

    The mask tokens should use the invariant culture; for example, the character used to separate the integral cna fraction components of a number (decimal separator) is a comma for some cultures, but when used in the MaskInput you hardcode the ".", because the mask anyalyzer interprets that as "use the decimal separator for whatever culture the control is running under".

    Having said that, I dont see anything wrong with the mask you assigned, so this might be a bug in the control.

Reply Children
No Data