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

NextPrevNumericAndAdvanced: Localization

2 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ellis
Top achievements
Rank 2
Ellis asked on 28 Apr 2009, 09:46 AM
Hi, i follow some guides and forum posts, to translate the NextPrevNumericAndAdvanced pager, but i lost an information on how to translate a label.
I do this:
Protected Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound 
        If TypeOf e.Item Is Telerik.Web.UI.GridPagerItem Then 
            Dim lblGoToPage As Label = DirectCast(e.Item.FindControl("GoToPageLabel"), Label) 
            If Not lblGoToPage Is Nothing Then lblGoToPage.Text = "Seleziona Pagina:" 
            Dim lbGoToPage As Button = DirectCast(e.Item.FindControl("GoToPageLinkButton"), Button) 
            If Not lbGoToPage Is Nothing Then lbGoToPage.Text = "Visualizza" 
            Dim lblPageSize As Label = DirectCast(e.Item.FindControl("ChangePageSizeLabel"), Label) 
            If Not lblPageSize Is Nothing Then lblPageSize.Text = "Comunicazioni per Pagina:" 
            Dim lbPageSize As Button = DirectCast(e.Item.FindControl("ChangePageSizeLinkButton"), Button) 
            If Not lbPageSize Is Nothing Then lbPageSize.Text = "Mostra" 
        End If 
    End Sub 

In the example i translate "GoToPageLabel" and "ChangePageSizeLabel", but in the grid i have another label contains "of number of pages as number".
How can i translate this label? what is its name?

thank you

Ellis

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Apr 2009, 09:55 AM
Hello Ellis,

You can try out the following code to change the text of the page of label:

vb:
Dim lblPageOf As Label = DirectCast(e.Item.FindControl("PageOfLabel"), Label) 
lblPageOf.Text = "CustomText" 

Thanks
Princy.
0
Ellis
Top achievements
Rank 2
answered on 28 Apr 2009, 10:09 AM
Hi Princy, i follow your example but i must change it.
I do this:
Dim lblPageOf As Label = DirectCast(e.Item.FindControl("PageOfLabel"), Label)
lblPageOf.Text = lblPageOf.Text.Replace("of""di"

I replace only "of", cause simple overwriting the text property of the label, i lost the number of pages.

Thank you Princy

Ellis
Tags
Grid
Asked by
Ellis
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Ellis
Top achievements
Rank 2
Share this question
or