I cant find out where to change the Language of a Drop Down Calendar of the UltraDateTimeEditor
We are using the :
Thread.CurrentThread.CurrentCulture.Name;
to Set the Language of the Solution and all Controls are reacting on that except of the DropDown.
I'd like to change the Display Layout to the selected Language of the DropDown Calendar!
So the Question is: "Where and how can i do this if my control inherits from UltraDateTimeEditor? Override Something or change some base properties ?"
Hello Gavin,
There are different approaches to solve this task. Maybe the easiest solution could be if you are using UltraCalendarCombo control instead of UltraDateTimeEditor. If you are using UltraCalendarCombo you could apply your CurrentCulture settings.
Option 2: If you need to use UltraDateTimeEditor
It is possible but please note that there is no built-in support. The dropdown part of our UltraDateTimeEditor is Microsoft`s MonthCalendar which supporting localization from LocalUserDefault registry key. For more details you could take a look at:http://msdn.microsoft.com/en-us/library/windows/desktop/bb760913%28v=vs.85%29.aspx#localization So, to be able to solve your task we could use the code below:
private void ultraDateTimeEditor1_BeforeDropDown(object sender, CancelEventArgs e) { originalLang = Registry.GetValue(@"HKEY_CURRENT_USER\Control Panel\International", "LocaleName", "en-US").ToString(); Registry.SetValue(@"HKEY_CURRENT_USER\Control Panel\International", "LocaleName", ultraComboEditor1.SelectedItem.DataValue); }
private void ultraDateTimeEditor1_AfterCloseUp(object sender, EventArgs e) { Registry.SetValue(@"HKEY_CURRENT_USER\Control Panel\International", "LocaleName", originalLang); }
Please take a look at the attached sample and video file for more details. If you have any questions, feel free to write me
Regards
Video file
Hi,
If you need any additional assistance don’t hesitate to ask.
Regadrs
sample