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

RadGrid localization

6 Answers 224 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sébastien
Top achievements
Rank 2
Sébastien asked on 14 Apr 2010, 03:58 PM
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.

6 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 19 Apr 2010, 10:17 AM
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.
0
Erik
Top achievements
Rank 2
answered on 14 Jul 2011, 11:48 AM
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


0
Mira
Telerik team
answered on 19 Jul 2011, 01:34 PM
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!

0
Erik
Top achievements
Rank 2
answered on 19 Jul 2011, 06:41 PM
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


0
Mira
Telerik team
answered on 20 Jul 2011, 02:56 PM
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!

0
Erik
Top achievements
Rank 2
answered on 20 Jul 2011, 04:44 PM
Yes,that did it Mira. 

Thanks.
Tags
Grid
Asked by
Sébastien
Top achievements
Rank 2
Answers by
Mira
Telerik team
Erik
Top achievements
Rank 2
Share this question
or