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.
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??
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
Thanks,
Mahalakshmi
Hi Mahalakshmi,
I am unable to see the attachment, can you reattach the sample.
Thanks,Ari Shaposhnik
Hi Ari,
Thanks for your response.
When "en-US" date format is assigned as MaskInput or FormatString, its M/d/yyyy.
So on entering the field, the date "9/13/2016" becomes "9/1/3___"
Attached is the sample and the screenshot.
Regards,
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); MessageBox.Show("Reset value " + originalLang); } private void ultraComboEditor1_SelectionChanged(object sender, EventArgs e) { CultureInfo ci = new CultureInfo(ultraComboEditor1.SelectedItem.DataValue.ToString()); string shortDateFormatString = ci.DateTimeFormat.ShortDatePattern; string shortTimeFormatString = ci.DateTimeFormat.ShortTimePattern; this.ultraDateTimeEditor1.MaskInput = Regex.Replace(shortDateFormatString, "[A-Za-z]", "#"); this.ultraDateTimeEditor1.FormatString = ci.DateTimeFormat.ShortDatePattern; ; } private void ultraDateTimeEditor1_AfterEnterEditMode(object sender, EventArgs e) { this.ultraDateTimeEditor1.PerformAction(Infragistics.Win.UltraWinMaskedEdit.MaskedEditAction.ToggleInsertionMode, false, false); } private void ultraDateTimeEditor1_Enter(object sender, EventArgs e) { this.ultraDateTimeEditor1.PerformAction(Infragistics.Win.UltraWinMaskedEdit.MaskedEditAction.FirstCharacter, false, false); this.ultraDateTimeEditor1.PerformAction(Infragistics.Win.UltraWinMaskedEdit.MaskedEditAction.SelectSection, false, false); }
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
For the first question related to the Calendar in DateTimeEditor, below is the Code.
Found the solution from a different discussion point. (http://ko.infragistics.com/community/forums/t/83519.aspx). for other questions, I will check and get back.