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


    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

  2. Alex Fidanov
    Alex Fidanov avatar
    637 posts

    Posted 09 Feb 2012 Link to this post


    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");
    Please note that this has to be done before the control is initialized.

    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 >>
Back to Top