Radgrid multilanguage problem

2 posts, 0 answers
  1. Kreshnik
    Kreshnik avatar
    3 posts
    Member since:
    Feb 2011

    Posted 21 Oct 2011 Link to this post

    Hello telerik team,

    Main problem:
    I'm having a problem with the RadGridView column header text localization

    Details:
    I've added a new language to my form(s) and therin are RadGridView controls,
    after localization is completed to all forms, while change/add some new columns for the radGridView
    the designer code generator that generates the code renames columns automatically (at design time),
    and makes the resource file in the other language unuseable for the translated columns.

    Example:
     i.e. I added in a language (resource file of form) a headerText in the resource file, but when I change some column property in the property builder the columns gets regenerated and renames automatically in the .designer class, and therefore some translations may not apply because of their 'new name'. I do very often changes to the RadGridView, but how to avoid this ?

    Version of telerik win controls I use:
    RadControls for winForms Q1 2011

    RadGridView.dll Version: 2011.1.11.315
    Visual Studio 2010 Ultimate Version

    Thanks in advance
  2. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 21 Oct 2011 Link to this post

    Hi Kreshnik,

    Thank you for writing.

    This is a known issue in RadGridView which will be addressed in one of our next releases. You can find an item for it in our Public Issue Tracking System.

    Because of the nature of the issue, it cannot be avoided at design-time. The only workaround that you can use in this case involves setting the strings of your RadGridView columns at runtime by code, for example:

    string cultureName = Thread.CurrentThread.CurrentUICulture.Name;
    switch (cultureName)
    {
        case "en-US":
            this.radGridView1.Columns["FirstName"].HeaderText = "First Name";
            this.radGridView1.Columns["LastName"].HeaderText = "Last Name";
            this.radGridView1.Columns["City"].HeaderText = "City Name";
            break;
        case "ar-EG":
            this.radGridView1.Columns["FirstName"].HeaderText = "الاسم الأول";
            this.radGridView1.Columns["LastName"].HeaderText = "اسم العائلة";
            this.radGridView1.Columns["City"].HeaderText = "مدينة";
            break;
    }

    With the help of this code snippet the header text of your columns will not depend on the design-time localization which causes the issues.

    I hope this helps.

    Greetings,
    Nikolay
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top