RadControls version
|
2009 Q1 +
|
.NET version |
3.5
|
Visual Studio version |
2005 and later
|
programming language |
C#
|
browser support |
all browsers supported by RadControls
|
PROJECT DESCRIPTION
Author: Walter van Leur (Walter)
The solution I’ve attached contains a project “TelerikRadGridLocalization” that does the localization of a RadGrid with the use of resource-files from codebehind.
There are two resource-files. One for english and one for dutch language.
There is another project (Demo) that demonstrates the use of the
localization by showing a RadGrid on the Customers in the Nwind-db.
How to use:
§ Add project “TelerikRadGridLocalization” to your solution
§ Add reference to project “TelerikRadGridLocalization”
§ Add a RadGrid (for example ID="RadGrid1") to your page (for example default.aspx)
§ In code-behind of that page (default.aspx.cs):
· Add the following to to the Page_load():
o RadGrid1.Localize();
This does the localization of most RadGrid-elements
· Add the following to the OnPreRenderComplete():
o RadGrid1.HeaderContextMenu.Localize();
This does the localization of the HeaderContextMenu
Example:
o How it works:
§ In project “TelerikRadGridLocalization” there is a class “RadGridLocalize” which contains extensions-mehods on the Radgrid.
The method “Localize(this RadGrid radGrid)” calls the other localize-methods on the different elements of a Radgrid (such as the FilterMenu, SortingSettings etc…).
§ Fot the localization of a RadGrid you can do a “RadGrid1.Localize()”
in the Page_load of the page. To have the HeaderContextMenu localized
you’ll have to do a “RadGrid1.HeaderContextMenu.Localize()” in the
OnPreRenderComplete because the HeaderContextMenu isn’t yet available
in the Page-Load.
o To see the dutch-localization working:
§ Notice that in web.config the following is set to use the culture of the browser:
· <globalization culture="Auto" uiCulture="Auto" />
§ Run the solution
§ Set the language to dutch in the browser:
· Internet Explorer; Tools; Internet Options; Languages
o Add language “dutch (nl-NL)”
o refresh the page
§ See the “Screenshot demo in dutch.docx”