RadDateTimePicker: culture is ignored

3 posts, 0 answers
  1. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 04 Jan 2012 Link to this post

    I have the following code:
    void Application_BeginRequest(object sender, EventArgs e)
    {
        var culture = Culture.GetBrowserOrDefaultCulture();
        culture.DateTimeFormat.ShortTimePattern = "HH:mm:ss";
        culture.DateTimeFormat.LongTimePattern = "HH:mm:ss";
        Thread.CurrentThread.CurrentCulture = culture;
        Thread.CurrentThread.CurrentUICulture = culture;
    }

    For instance, I set US culture in my browser. Everything changes accordingly in my page output.
    However, RadDateTimePicker keeps showing datetime in some specific - I guess, OS-defined, format and does not care this setting.

    How to fix this?

    I just want it to pick up the culture, set for the thread - I don't want to write special code for every RadDateTimePicker on my pages - I have tons of them!
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Jan 2012 Link to this post

    Hello Alexander,

    Check the following help documentation which explains the same.
    Specifying a Culture.

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 04 Jan 2012 Link to this post

    Hi, thanks,

    i've seen this page.
    But it is 'per instance' solution. And i need a global solution... For all pickers on all pages...
    Something more elegant, than FindControl(...) in base page. Especially taking into account that I have several base page classes.

    p.s. Ok, had anyway to do this via Find controls recursively...
Back to Top