This is a migrated thread and some comments may be shown as answers.

Problem with MaskEditTextbox and decimal values

1 Answer 174 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Heinz Schmitz
Top achievements
Rank 1
Heinz Schmitz asked on 13 Oct 2010, 03:49 PM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 13 Oct 2010, 07:27 PM
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
Tags
MaskedEditBox
Asked by
Heinz Schmitz
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Share this question
or