RadGrid localization

7 posts, 0 answers
  1. Sébastien
    Sébastien avatar
    60 posts
    Member since:
    Aug 2008

    Posted 14 Apr 2010 Link to this post

    Hi Telerik's team,

    I would like to change the RadGrid context language according to the selected culture as recommended by Microsoft. For example, the "Add new record" button, "Refresh", "Go to page", "Change", "Go", "Page size" ...
    How can we achieve this ?
    I'm using DotNetNuke and this works with a few easy changes in RadEditor, I hope it works the same in RadGrid :)

    Thank you

    S.F.
  2. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 19 Apr 2010 Link to this post

    Hello Sébastien,

    Please take a look at the following help topics explaining how the desired functionality can be achieved:
    Localizing the grid messages
    Localizing the grid headers
    Localizing the Command item

    If you want to use language sources, located in resource files, please examine this help topic.

    All the best,
    Mira
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 14 Jul 2011 Link to this post

    Hello,

    Regarding header localization:
    I have an automated system that get localized text from the database. I want to localize all headers for every grid and the function know therefore not all columnnames. So:
    Dim button As LinkButton = CType(headerItem("ContactName").Controls(0), LinkButton)
    button.Text = "My customized contact name"
    is not known, but the Item property of the GridHeaderItem class only accepts strings, the uniquename property I gues? the propert is not documented: http://www.telerik.com/help/aspnet/grid/radgrid-telerik.webcontrols.gridheaderitem_members.html here...

    So: how can I loop all headers and what is the input string, in this example "ContactName" referring to? UniqueName of the column? and what if there is no UniqueName given for a column...

    Thanks,

    Erik


  5. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 19 Jul 2011 Link to this post

    Hello Erik,

    You can traverse all grid columns and set their header text using the following code:
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
        {
            column.HeaderText = "some text";
        }
    }

    I hope this helps.

    Greetings,
    Mira
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 19 Jul 2011 Link to this post

    Thanks Mira,

    That does look better, I can even get the datafield this way.

    only problem is that it does not work... settings the column headers text and even setting PagerStyle.PrevPageToolTip in the radgrid prerender still displays the original text and not the changed text. when I debug I can see that the "PagerStyle.PrevPageToolTip" value is changed, to dutch in this case, but it renders english... and so do the column headers...

    Why is that you think?

    Regards,

    Erik


  7. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 20 Jul 2011 Link to this post

    Hello Erik,

    This approach requires a rebind of the grid in order the changes to be applied:
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
        {
            column.HeaderText = "some text";
        }
        RadGrid1.Rebind();
    }

    I hope this helps.

    Best wishes,
    Mira
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  8. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 20 Jul 2011 Link to this post

    Yes,that did it Mira. 

    Thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017