Localization of RadDateTimePicker

7 posts, 0 answers
  1. JP
    JP avatar
    120 posts
    Member since:
    Aug 2011

    Posted 03 May 2012 Link to this post

    Hi,

    many Telerik controls can be localized using the given .resx files in App_GlobalResources. Is this also possible for the calendar controls (RadDateTimePicker, RadDatePicker, ...)? We are currently using Q3 2011.

    Thanks!

  2. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 08 May 2012 Link to this post

    Hi Jan-Patrick,

    Thank you for contacting us.

    I am glad you have found out that RadControls provide localization resource files for the controls located in the mentioned install folder. However I am afraid you will need to modify manually any other control in order to apply on it a custom language configuration.

    RadCalendar supports Culture based localization. For example you could declare its culture as
    "de-DE" and it will change its days, tooltips and months to German. You can apply this setting either:

    declaratively:
    <telerik:RadDatePicker ID="RadDatePicker1" Runat="server"
    Culture="de-DE" ></telerik:RadDatePicker>

    Copy Code

    programmatically:

    Copy Code
    protected void Page_Load(object sender, EventArgs e)
    {
    RadDatePicker1.Calendar.CultureInfo = new System.Globalization.CultureInfo("de-DE");
    }

    by changing the culture:

    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");

    I hope this will be helpful. Let me know if you have any further questions.


    Regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. JP
    JP avatar
    120 posts
    Member since:
    Aug 2011

    Posted 08 May 2012 Link to this post

    Hello,

    I've already seen that most of the control is localized when using the correct culture. But some texts are still english ("Today", "Cancel" in the calendar's month/year picker). When will/How can this be localized?
  5. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 10 May 2012 Link to this post

    Hi Jan-Patrick,

    You will have to modify them manually as shown in the example below:
    C#:
    RadDatePicker1.Calendar.FastNavigationSettings.TodayButtonCaption = "Heute"; RadDatePicker1.Calendar.FastNavigationNextText = "Nächste";
    RadDatePicker1.Calendar.FastNavigationNextToolTip = "Ändern vorn";
     
    RadMonthYearPicker1.MonthYearNavigationSettings.TodayButtonCaption = "Heute";
    RadMonthYearPicker1.MonthYearNavigationSettings.NavigationNextText = "Nächste";
    RadMonthYearPicker1.MonthYearNavigationSettings.NavigationNextToolTip = "Ändern vorn";


    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Oliver
    Oliver avatar
    1 posts
    Member since:
    May 2007

    Posted 30 Oct 2012 Link to this post

    ok, but what about when we use a GridDateTimeColumn within a RadGrid ?

     

  7. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 02 Nov 2012 Link to this post

    Hello Oliver,

    In this case you could try:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridFilteringItem)
        {
            GridFilteringItem filterItem = e.Item as GridFilteringItem;
            RadDatePicker combo = filterItem["OrderDate"].Controls[0] as RadDatePicker;
     
            combo.SharedCalendar.FastNavigationSettings.TodayButtonCaption = "Heute";
            combo.SharedCalendar.FastNavigationNextText = "Nächste";
            combo.SharedCalendar.FastNavigationNextToolTip = "Ändern vorn";
        }
    }

    I hope this will prove helpful. Please give it a try and let me know about the result.

    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Gideon
    Gideon avatar
    1 posts
    Member since:
    Oct 2016

    Posted 18 Oct in reply to Eyup Link to this post

    To make the Solution of Eyup generic you could do this:

    static void rg_ItemDataBound(object sender, GridItemEventArgs e)
    {
       if (e.Item is GridFilteringItem)
       {
        GridFilteringItem filterItem = e.Item as GridFilteringItem;
        GridColumn[] renderColumns = filterItem.OwnerTableView.RenderColumns;
        GridColumn[] array = renderColumns;
        for (int i = 0; i < array.Length; i++)
        {
          GridColumn gridColumn = array[i];
          if (filterItem[gridColumn.UniqueName].Controls.Count > 0)
          {
            if (filterItem[gridColumn.UniqueName].Controls[0].GetType() == typeof(RadDatePicker))
            {
              RadDatePicker combo = filterItem[gridColumn.UniqueName].Controls[0] as RadDatePicker;
              combo.SharedCalendar.FastNavigationSettings.TodayButtonCaption = "Heute";
              combo.SharedCalendar.FastNavigationNextText = "Nächste";
              combo.SharedCalendar.FastNavigationNextToolTip = "Ändern vorn";
            }
          }
        }               
      }
    }
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017