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

Globalization does not work out of the box

1 Answer 55 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 08 Feb 2012, 09:57 AM
Hey!

Globalization does not work out of the box with MaskedInput. Concerning DateTimePicker it works great.
But with MaskedInput i have to set:
this.annualEffort.Culture = Thread.CurrentThread.CurrentCulture;

I have a page with 15 MaskedInput Controls. Is there a better solution? I don't want so set them manually!

Thanks in advance

Andi

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 09 Feb 2012, 01:17 PM
Hi,

Which build are you using? The masked input controls, by default, set the CultureInfo.CurrentCulture, which will be the one on your machine. You can also change the current culture using the Thread.CurrentThread:

System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
InitializeComponent();
Please note that this has to be done before the control is initialized.

Greetings,
Alex Fidanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Andreas
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or