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

RadDateTimePicker: culture is ignored

2 Answers 73 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 04 Jan 2012, 12:53 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Jan 2012, 02:26 PM
Hello Alexander,

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

-Shinu.
0
Alexander
Top achievements
Rank 1
answered on 04 Jan 2012, 03:31 PM
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...
Tags
Calendar
Asked by
Alexander
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Alexander
Top achievements
Rank 1
Share this question
or