Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Globalisation feature in Date Control: UltraDateTimeEditor + UltraCalendarCombo
posted

Hi,

When I set the CurrentCulture and CurrentUICulture, the Calendar which pops up after clicking dropdown in UltraDateTimeEditor, does not change language accordingly.

Example if its German, for June it must display Juni.

This works when I use UltraCalendarCombo.

Is there a way, I can use the Calendar used in UltraCalendarCombo in UltraDatetimeEditor?

 

Below are the list of requirements which we need in the Date Field.

  • Date Entry : Only numbers must be keyed and not the separators. Eg: Type 09082016 continuously

Is there a way to overwrite the number as we type. Instead of using a delete/backspace to clear whats displayed to type a new value??

  • Highlight & Navigation : With the Cursor move each part of the date must be highlighted (Date or month or Year)

                                     When we press Right arrow, 2nd Part of the date, that is "06" must be highlighted/Selected. E.g.: 09/06/2016, if Cursor in 09, then Right arrow must highlight 06, again right arrow must highlight 2016. Vice versa

  • Spin Button : Should Spin the selected part of the date and not the entire date (Date Field having 09/06/2016, click on UP will increment the date part selected. that is, if 09 is selected, then it becomes 10/06/2016, if 06 was selected then date should be 09/07/2016. If year then 09/06/2017.) Additionally, when UP arrow is used and number 31 comes for September then it must increment it automatically to October  E.g.: 09/30/2016 -> UP Arrow changes to -> 10/01/2016.

 

Thanks,

Mahalakshmi

Parents
No Data
Reply
  • 210
    posted

    Hi Mahalakshmi,

    The answer posted above is the correct way to do this, more specifically this piece of code will achieve what you want.

    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", "ge-GE");
    }

    and

     private void ultraDateTimeEditor1_AfterCloseUp(object sender, EventArgs e)
            {
                Registry.SetValue(@"HKEY_CURRENT_USER\Control Panel\International", "LocaleName", originalLang);
                MessageBox.Show("Reset value " + originalLang);
            }

    in order to revert the registry to the original language on close.

    Our ultraDateTimeEditor has the Date Entry and Spin Button features that are in your list already implemented. To achieve the Highlight & Navigation portion you will have to change the selectionstart and selectionlength properties in on the ultraDateTimeEditor. I can write up a sample for you if you need it.

    Please let me know if I can assist you further.

    Regards,
    Ari Shaposhnik

Children