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

Problems with setting texts in RadMonthYearPicker

4 Answers 21 Views
MonthYearPicker
This is a migrated thread and some comments may be shown as answers.
Jenny
Top achievements
Rank 1
Jenny asked on 25 Mar 2016, 12:37 PM

I would like to use the RadMonthYearPicker Component in an application with Swedish language. I need two Controls for letting the users to define a period. But I have a problem with setting the texts on the Today and Cancel buttons.

I've tried changing the settings in MonthYearNavigationSettings in the Page_Load, but just the first call for each Component makes an impact on the result.

For example:

rmypFromDatum.MonthYearNavigationSettings.CancelButtonCaption = "Avbryt";
rmypFromDatum.MonthYearNavigationSettings.TodayButtonCaption = "Idag";
rmypTomDatum.MonthYearNavigationSettings.TodayButtonCaption = "Idag";
rmypTomDatum.MonthYearNavigationSettings.CancelButtonCaption = "Avbryt";

then in the first Component, rmypFromDatum, the text on the Cancel Button is changed to "Avbryt", but the text on the Today button is English - Today. And vice versa - on the second Component the Today button has the text changed to "Idag" but the Cancel button has the text "Cancel.

When a button is clicked on the page and the page is reloaded both the buttons - Today and Cancel - get the Swedish texts.

What shall I do to make my Changes to be visible the first time the users open the Components. Please help!

Best regards,

Jenny

 

 

 

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Mar 2016, 10:31 AM
Hello Jenny,

Try to apply these localization settings in an earlier stage of the page life cycle. For example:
protected void rmypFromDatum_Init(object sender, EventArgs e)
{
    RadMonthYearPicker picker = sender as RadMonthYearPicker;
    picker.MonthYearNavigationSettings.CancelButtonCaption = "Avbryt";
    picker.MonthYearNavigationSettings.TodayButtonCaption = "Idag";
    picker.MonthYearNavigationSettings.OkButtonCaption = "Godta";
}

I hope this will prove helpful.

Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Boris
Top achievements
Rank 1
answered on 16 Jan 2019, 09:59 AM
Even this does not help. Only the 1st assigned text is applied, any further Caption Text assignment does not set the Text. So when I start to set picker.MonthYearNavigationSettings,CancelButtonCaption this is changing, but further captions (e.g. TodayButtonCaption) does not. Same in opposite order, changing the TodayButtonCaption at 1st, does the Change, but following CancelButtonCaption does not.
0
Boris
Top achievements
Rank 1
answered on 16 Jan 2019, 10:05 AM
Additional Info: 2018.2.516.45
0
Eyup
Telerik team
answered on 21 Jan 2019, 09:27 AM
Hi Boris,

Generally, you can achieve this requirement by using a resx globalization file as demonstrated in the following article:
https://docs.telerik.com/devtools/aspnet-ajax/controls/calendar/accessibility-and-internationalization/localization-through-global-resources

Alternatively, you can try setting the code-behind properties in a later stage of the page life cycle, for example Page_PreRender or PreRenderComplete.

You can also set these captions on client-side:
https://www.telerik.com/forums/localization-of-raddatetimepicker#hz137PnF6kCfm_StXC7vgA

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MonthYearPicker
Asked by
Jenny
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Boris
Top achievements
Rank 1
Share this question
or