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

grid localization

20 Answers 259 Views
Grid
This is a migrated thread and some comments may be shown as answers.
alvaro
Top achievements
Rank 1
alvaro asked on 19 Feb 2008, 03:10 PM
Hello, I'm trying to localize a RadGrid control with paging using resource files. The paging mode is "Next, Previous and Pages". In my resource file I have an entry called PagerTextFormat whos value is: "Change page: {4} &nbsp;Displaying page {0} of {1}, items {2} to {3} of {5}.", when I run it my page I have no values on parameter {4}, but in the others parameters  the values are there.  For explaning better, I'd like to view something like "Change page: < 1 2 >    Displaying page 1 of 2, items 1 to 3 of 4", instead of "Change page: <  >    Displaying page 1 of 2, items 1 to 3 of 4". The cuestion is, has the text  "Change page: {4} &nbsp;Displaying page {0} of {1}, items {2} to {3} of {5}." a format well formed to the localization? Someone had the same problem?
Thanks in advance

Alvaro

20 Answers, 1 is accepted

Sort by
0
Kiara
Top achievements
Rank 1
answered on 22 Feb 2008, 12:41 PM
Most probably the resource key for the forth parameter does not match as you said that the other pager elements are localized properly. Can you check that? Take a look at this chapter from the docs as well.

Kiara
0
alvaro
Top achievements
Rank 1
answered on 22 Feb 2008, 02:20 PM
Kiara,
I obtained the value of my entry ("Change page: {4} &nbsp;Displaying page {0} of {1}, items {2} to {3} of {5}.") in the Property Builder of my grid, most precisely in the toggle property section. Thus I can't figure out why the localization doesn't work properly.
Do you have any clue?
Thanks in advance, regards

Alvaro.
0
Kiara
Top achievements
Rank 1
answered on 25 Feb 2008, 11:54 AM
I am a bit confused - in your previous post you said that you use global resource files to localize the grid pager. Did you take a look at the bottom section of the help topic from my previous reply? Have you verified that the resource keys  for the arguments passed for the pager parts match? Hope this helps.

Kiara
0
alvaro
Top achievements
Rank 1
answered on 25 Feb 2008, 02:05 PM
The key for paging section of the grid is "RadGridCustomerResource1.MasterTableView.PagerStyle.PagerTextFormat" and the value "Change page: {4} &nbsp;Displaying page {0} of {1}, items {2} to {3} of {5}.". The problem seems to be that when replacing the parameters with the corresponding information the fourth one is not correctly filled by the grid. The value was copied and pasted from the PagerTextFormat atribute value in the PagerStyle section from the grid, is this the correct procedure? I believe I've followed all the instructions from your previous post link.

Thanks in advance,
Yours faithfully,

Alvaro
0
Iana Tsolova
Telerik team
answered on 26 Feb 2008, 02:59 PM
Hello alvaro,

Find attached a working sample where you can see how the PagerTextFormat works as expected. Please let us know if that is the behavior you expect or if you are doing something different.

For more information about PagerTextFormat vist this online help topic.

Regards,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
alvaro
Top achievements
Rank 1
answered on 27 Feb 2008, 02:30 PM
The problem arises when I try to localize the grid, with no localization I havenĀ“t any problem.
Thanks in advance
Regards

Alvaro
0
Benjamin Millspaugh
Top achievements
Rank 1
answered on 10 Mar 2008, 02:58 PM
I have the same problem.  When I add localization the text "Change page: < 1 2 >" changes to "Change page: < >" and I have no idea how to get the numbers back.  Your previous post does not appear to address this and I read the article you sent but I still don't see how to get the numbers back.

Also, the sample you provided does NOT have any resources in it.  When you first open the file you will see the page numbers at the bottom but as soon as you generate local resources for that file (In Design View - Tools / Generate Local Resource) they disappear.  You should be able to replicate this pretty easily.
0
Benjamin Millspaugh
Top achievements
Rank 1
answered on 10 Mar 2008, 03:09 PM
Also, if you change the value of CommandItemDisplay from "None" to "Top" in MasterTableView you will see another localization related problem....the images in the command bar are all broken.

This is not a great "default" result.  I would still like to use the default images which are not language specific but my company requires that I generate resources for everything which causes this error.

If you look in the resource file you will see that it generated resources with some sort of Telerik reference to the image file which breaks the code:

  <data name="RadGrid1Resource1.MasterTableView.CommandItemSettings.AddNewRecordImageUrl" xml:space="preserve">
    <value>mvwres:1-Telerik.Web.UI.Skins.Default.Grid.AddRecord.gif,Telerik.Web.UI, Version=2007.3.1425.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4</value>
  </data>
  <data name="RadGrid1Resource1.MasterTableView.CommandItemSettings.RefreshImageUrl" xml:space="preserve">
    <value>mvwres:1-Telerik.Web.UI.Skins.Default.Grid.Refresh.gif,Telerik.Web.UI, Version=2007.3.1425.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4</value>
  </data>
0
Benjamin Millspaugh
Top achievements
Rank 1
answered on 10 Mar 2008, 05:34 PM
I wanted to note that when resources are generated there is an item called PagerStyle.PagerTextFormat which contains the default value "Change page: {4} &nbsp;Displaying page {0} of {1}, items {2} to {3} of {5}." which would appear to be correct but it does not seem to work.  It looks like everything is working except {4} since we do see the right hand data "Displaying page 1 of 3, items 1 to 5 of 14." but none of the numbers on the left.  This would seem to point to a Telerik issue related to that attribute.
0
Yavor
Telerik team
answered on 12 Mar 2008, 09:38 AM
Hello,

We will investigate the issue with the resource files, and update this thread as needed.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Benjamin Millspaugh
Top achievements
Rank 1
answered on 12 Mar 2008, 12:52 PM
Hello,

I will anxiously await the results of your investigation regarding the issue with the resource files, and update this thread as needed.

Greetings,
Ben
0
Yavor
Telerik team
answered on 17 Mar 2008, 01:33 PM
Hi Benjamin,

Here is the update I promised after testing further the issue stated initially.
When setting the pager format, in the resource file please make sure you use the 
RadGrid1Resource1.MasterTableView.PagerStyle.PagerTextFormat property, rather than 
RadGrid1Resource1.PagerStyle.PagerTextFormat

Further, with respect to the images, in order to make sure that they are properly displayed, you can set the correct url in the resource file, since the framework is erroneously generating the path to point to the resource where the image is actually coming from.

These points are demonstrated in the project sample attached to this message.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
alvaro
Top achievements
Rank 1
answered on 17 Mar 2008, 06:02 PM
Yavor, I cannot see any attach file in your message.
Regards

Alvaro
0
Yavor
Telerik team
answered on 18 Mar 2008, 07:18 AM
Hi alvaro,

The attachment must have been stripped somehow.
You will find the project in this message.
I hope it helps.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
alvaro
Top achievements
Rank 1
answered on 18 Mar 2008, 02:28 PM
Yavor, as you can see in your example in the resource file the item called RadGrid1Resource1.MasterTableView.PagerStyle.PagerText which contains the value "TEST: &nbsp;Displaying page {0} of {1}, items {2} to {3} of {5}. MOVED>> {4}<<" is not displaying the value for the {4} parameter, which should be the page number. That is my original problem explained in the first post. Can you check why is having this behaviour?
Best wishes

Alvaro
0
Yavor
Telerik team
answered on 24 Mar 2008, 08:56 AM
Hello alvaro,

The placeholder that you mentioned actually points to the pager buttons. The curent mapping is as follows:

  • {0} is used to display current page number.
  • {1} is total number of pages.
  • {2} will be replaced with the number of the first item in the current page.
  • {3} will be set to the number of the last item in the current page.
  • {4} indicates where pager buttons would appear.
  • {5} corresponds to number of all items in the datasource
I hope this information helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
alvaro
Top achievements
Rank 1
answered on 24 Mar 2008, 01:02 PM
Ok, so I assume that there are no placeholder to the page numbers links? It's funny because if I not localize the grid, the page numbers appears between the page buttons corresponding with the parameter {4}.
It's this true? or I'm making an wrong assumption?
Thanks, regards

Alvaro
0
Yavor
Telerik team
answered on 25 Mar 2008, 09:20 AM
Hello alvaro,

Let us assume that you have a pager with: 

<

PagerStyle Mode="NextPrevAndNumeric" />

In this case both Next/Prev and the page numbers will be rendered. The {4} placeholder will be responsible for both of them.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
alvaro
Top achievements
Rank 1
answered on 07 Apr 2008, 08:03 PM
The problem was solved!
I'll explain wich steps I followed:
I have a pager with PagerStyle Mode="NextPrevAndNumeric" and RadGrid1Resource1.MasterTableView.PagerStyle.PagerTextFormat containing the default value "Change page: {4} &nbsp;Displaying page {0} of {1}, items {2} to {3} of {5}.".  The problem occurs when the page is reloaded - by the localization - it lost the page mode, hence it takes the default mode for this PagerTextFormat wich is NextPrev. The way that I found to solve that is putting in on the resource file the pager mode, that is: "RadGrid1Resource1.MasterTableView.PagerStyle.Mode = NextPrevAndNumeric".
Hope this helps to someone.

Regards

Alvaro
0
Antoine
Top achievements
Rank 1
answered on 26 Apr 2008, 07:20 PM
Thanks Avaro!
Tags
Grid
Asked by
alvaro
Top achievements
Rank 1
Answers by
Kiara
Top achievements
Rank 1
alvaro
Top achievements
Rank 1
Iana Tsolova
Telerik team
Benjamin Millspaugh
Top achievements
Rank 1
Yavor
Telerik team
Antoine
Top achievements
Rank 1
Share this question
or