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

[Solved] LocalResource localization breaking with telerik

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 11 Jul 2013, 09:55 PM
Hi all,

Here's a weird situation. I am using ASP.NET web forms and have created a simple user control named TestControl.ascx. This control contains three asp:Labels. I went to design view in Visual Studio, then Tools -> Generate Local Resources. This created a App_LocalResources folder where the control is located, and added a TestControl.ascx.resx file within. I duplicated this file and named the duplicate copy TestControl.ascx.pt.resx to support Portuguese. I placed the control on a standard ASP.NET page and it works as expected.

Here is where Telerik seems to break it. I try to add a very simple telerik:RadGrid to the TestControl.ascx user control as follows:

<telerik:RadGrid runat="server" ID="TestRadGrid">
        <MasterTableView runat="server">
            <Columns>
                <telerik:GridBoundColumn UniqueName="ProgramColumn" HeaderText="Program" DataField="ProgramName" meta:resourcekey="ProgramGridBoundColumnResource1" />
            </Columns>
        </MasterTableView>
</telerik:RadGrid>


Inside of the local resource files I have the following key: ProgramGridBoundColumnResource1.HeaderText and I set the value accordingly. For some reason, however, when I run this, I get a "Parser Error" that says type GridBoundColumn does hot have a property "HeaderTextpt". I have no idea why this is happening. It literally takes the '.pt' part out of the local resource file name (TestControl.ascx.pt.resx) and appends it to the property specified in the file. I have no idea why it is doing this. However, when I delete the .pt resource file and only have TestControl.ascx.resx (a single resource file), it seems to work just fine. It is only when I add a second resource file with the ".pt.resx" extension that it fails. I have also tried with spanish ('es') but to no avail.

Please provide guidance as to why this is happening!!!

Thanks,
- Patrick


1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 16 Jul 2013, 09:31 AM
Hi,

 Indeed such behavior is unexpected and should not normally occur.
I followed your description and prepared a very basic project that shows the localization of the HeaderText property of the grid column.
When the browser language settings are set to Portuguese the ASP.NET framework will automatically load the correct resource file and show the localized text in the header.
You can have a look at the attached project for further reference on how to setup the localization in the grid.

Regards,
Marin
Telerik
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 the blog feed now.
Tags
Grid
Asked by
Patrick
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or