Completed
Last Updated: 10 Jun 2016 05:17 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 09 Jun 2016 08:54
Category: Editors
Type: Bug Report
0
FIX. RadDateTimePicker/RadTimePicker - close button is not localized in the time picker
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radDateTimePicker1.Culture  = new System.Globalization.CultureInfo("en-GB");
    RadTimePickerLocalizationProvider.CurrentProvider = new MyTimePickerLocalizationProvider();
    this.radDateTimePicker1.DateTimePickerElement.ShowTimePicker = true; 
} 

class MyTimePickerLocalizationProvider : RadTimePickerLocalizationProvider
{
    public override string GetLocalizedString(string id)
    {
        switch (id)
        {
            case RadTimePickerStringId.HourHeaderText:
                return "TEST Hours";
            case RadTimePickerStringId.MinutesHeaderText:
                return "TEST Minutes";
            case RadTimePickerStringId.CloseButtonText:
                return "TEST CLOSE";
            default:
                return string.Empty;
        }
    }
}

Workaround:
 RadDateTimePickerCalendar calendarBehaviorFrom = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;
 calendarBehaviorFrom.Calendar.ShowFooter = true;
 calendarBehaviorFrom.PopupControl.Opened += PopupControl_PopupOpened;

private void PopupControl_PopupOpened(object sender, EventArgs args)
        {
            RadDateTimePickerDropDown dd = sender as RadDateTimePickerDropDown;
            TimePickerDoneButtonContent buttonContent = ((RadPanel)dd.HostedControl).Controls[2] as TimePickerDoneButtonContent;
            var doneButton = ((Telerik.WinControls.UI.TimePickerDoneButtonElement)(buttonContent.RootElement.Children[0]));
            doneButton.ButtonElement.Text = RadTimePickerLocalizationProvider.CurrentProvider.GetLocalizedString(RadTimePickerStringId.CloseButtonText); 
        }
Attached Files:
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments