Problem with MaskEditTextbox and decimal values

2 posts, 1 answers
  1. Heinz Schmitz
    Heinz Schmitz avatar
    1 posts
    Member since:
    Jul 2009

    Posted 13 Oct 2010 Link to this post

    Hello Telerik,

    we are currently working on a project where we using your masked textbox. We bounded a BindingSource (System.Windows.Forms.BindingSource) to a RadMaskedEditBox. The BindingSource is linked to a class instance with several properties (string, double etc.).
    The textbox is masked with "c2" and the masktype is "numeric". Our problem is when we are entering a value and the group or decimal seperator is a comma, for example "200,00", the value becomes 20000,00 (we are a german developer team). The same goes for english number formats the moment a comma is involved (2,000.00 becomes 200,000.00).
    The property the textbox is linked to contains a value of the datatype double.

    Is there a solution to this problem because we really want to use your controls.

    Here a some more information about our configuration:
    OS: XP and Win7
    Telerik: RadControls fpr WinForms Q10

    thanks in advance and greetings from germany
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 13 Oct 2010 Link to this post

    Hello Heinz,

    The problem here is with the CurrentCulture, because you have that set to US, the Convert.ToDouble(value, IFormatProvider) is receiving the wrong format,
    To fix this, just change the CurrentThread.CurrentCulture like this:
    Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
Back to Top