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

Localize Grid pager

5 Answers 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andreas Dahlén
Top achievements
Rank 1
Andreas Dahlén asked on 09 Jun 2010, 03:57 PM
Hi!

I have a grid with a detailtable, which contains a detailtable.

I wants to localize the Pager tooltips (FirstPageToolTip, LastPageToolTip etc) and the Pager texts (PageSizeLabelText, PageTextFormat).

But it doesn't work on all tables.

I've tried to set it in Pre_Render
protected void RadGrid1_PreRender(object sender, EventArgs e) 
            RadGrid grd = (RadGrid)sender; 
            grd.PagerStyle.FirstPageToolTip = "Första sidan"
            grd.PagerStyle.AlwaysVisible = true
 

I've also tried to set PagerStyle-FirstPageToolTip="Första sidan" in <telerik:RadGrid> and <telerik:GridTableView>

Also tried to set <PagerStyle FirstPageToolTip="Första sidan" /> within the <mastertableview> and <telerik:GridTableView>

Independent on the settings above, I get English tooptips and texts.

Telerik version used is "2010.1.519.35"

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 09 Jun 2010, 04:12 PM
Hi Andreas,

Go through the following article and let me know if it helps:
Pager item (Localizing GridPagerItem strings section)

Best wishes,
Pavlina
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
Clive Hoggar
Top achievements
Rank 1
answered on 29 Jul 2010, 03:56 PM
Hi

I am trying to localize the text 'Page size'   and ' x items in n pages', but I don't see a way to do it
from the referenced docs. Is there a way to do this?

Thanks

Clive
0
Shinu
Top achievements
Rank 2
answered on 30 Jul 2010, 07:04 AM
Hello Clive,


Set the PageSizeLabelText property as per your requirement in order to show the text in place of "Page Size".

aspx:
<MasterTableView PageSize="8" CommandItemDisplay="Top" AutoGenerateColumns="False"
    DataSourceID="SqlDataSource1">
    <CommandItemSettings ShowAddNewRecordButton="false" />
    <PagerStyle Mode="NextPrevAndNumeric" PageSizeLabelText="Size"/>
    <Columns>


And Set the PagerTextFormat in order to change the text that will be displayed in the grid pager.
Using PagerTextFormat


-Shinu.
0
Clive Hoggar
Top achievements
Rank 1
answered on 30 Jul 2010, 01:28 PM
Hi

Thanks. This works declaratively, but I would like to set this value in code behind
so it is conditional on a language setting.   I have tried a number of alternatives in different
page and grid events, but no result yet.

Can you give me a code snippet to do this, in the correct event?  VB for preference, or I'll convert it.

Thanks

Clive
0
Pavlina
Telerik team
answered on 02 Aug 2010, 04:32 PM
Hello Clive,

Please examine the code snippet below and let me know if further assistance is needed:
VB.NET:
Protected Sub RadGrid1_PreRender(sender As Object, e As EventArgs)
    RadGrid1.PagerStyle.PageSizeLabelText = "Custom text"
    RadGrid1.PagerStyle.PagerTextFormat = "Navigate pages {4} Page {0} from {1}, rows {2} to {3} from {5}"
    RadGrid1.Rebind()
End Sub

Regards,
Pavlina
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
Tags
Grid
Asked by
Andreas Dahlén
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Clive Hoggar
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or