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

[Solved] Localization

3 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fernandes
Top achievements
Rank 1
Fernandes asked on 29 Dec 2007, 07:32 PM
Hi!

We use a lot of Grids in our application, so I've created a class (that inherits from RadGrid: 

public class BaseGrid : Telerik.Web.UI.RadGrid  
    {  
        protected override void OnPreRender(EventArgs e)  
        {  
            this.AllowMultiRowEdit = false;  
            this.Skin = "Telerik";  
            this.GridLines = GridLines.None;  
 
            this.MasterTableView.NoMasterRecordsText = "No records custom message!";  
 
            // Call the base class's OnLoad method!              
            base.OnPreRender(e);  
        }  
 

This helps me to reduce the time whenever the Client wants to change the appearance of all grids in the application.

The Skin property works great, I mean, if I change the skin on the base class every grid will change its appearance too.

The problem is that I'm trying to localize the grid messages the same way. But the line :

this.MasterTableView.NoMasterRecordsText = "No records custom message!";

produces no effect, since I'm getting the default "No records to display." message.

Is this the best approach to localize every message in all the grids in my application? Does anybody knows why this isn't working?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Vladimir
Top achievements
Rank 1
answered on 01 Jan 2008, 09:48 PM
fernandesss,

If the grid is bound before PreRender this setting will not take effect - the grid control are already created. Please verify this at your end.

Vlad
0
Fernandes
Top achievements
Rank 1
answered on 02 Jan 2008, 12:50 PM
Ok Vlad,

I'll look into RadGrid life cyle, and ill post the result.

Thanks a lot!
0
Fernandes
Top achievements
Rank 1
answered on 05 Jan 2008, 08:35 PM
    protected override void OnInit(EventArgs e)  
        {  
            this.MasterTableView.NoMasterRecordsText = "Não existem registos.";  
            base.OnInit(e);  
        }  
 

Worked like a charm!!

Thanks
Tags
Grid
Asked by
Fernandes
Top achievements
Rank 1
Answers by
Vladimir
Top achievements
Rank 1
Fernandes
Top achievements
Rank 1
Share this question
or