Globalization does not work out of the box

2 posts, 0 answers
  1. Andreas
    Andreas avatar
    14 posts
    Member since:
    Feb 2011

    Posted 08 Feb 2012 Link to this post

    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
  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 09 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
Back to Top