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

radalert : cutomized button text

5 Answers 319 Views
Window
This is a migrated thread and some comments may be shown as answers.
Raja
Top achievements
Rank 1
Raja asked on 05 Jun 2009, 05:07 AM
Hi,

Is it possible to customize the button labels for radalert, radconfirm and radprompt? Specifically, I would like to know whether we can localise the label text?

Thanks

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Jun 2009, 05:45 AM
Hello Raja,

You can change the localization strings of the RadWindow for ASP.NET AJAX control by adding the following JavaScript code that should be placed after the RadWindow / RadWindowManager declaration.

 
Telerik.Web.UI.RadWindowUtils.Localization =     
{    
    "Close" : "Close",    
    "Minimize" : "Minimize",    
    "Maximize" : "Maximize",    
    "Reload" : "Reload",    
    "PinOn" : "Pin on",    
    "PinOff" : "Pin off",    
    "Restore" : "Restore",    
    "OK" : "Custom text for OK",    
    "Cancel" : "Custom text for Cancel",    
    "Yes" : "Custom Text for Yes",    
    "No" : "Custom text for No"      
};  

Also refer the following documentation which describes about changing predefined dialog templates .
Changing the Dialog Templates

Thanks,
Shinu.
0
Raja
Top achievements
Rank 1
answered on 05 Jun 2009, 06:05 AM
Hi,

Can you provide a more complete example (ie where to add the javascript code)?

Thanks
0
Raja
Top achievements
Rank 1
answered on 05 Jun 2009, 06:13 AM
Hi,

Namespace 'Telerik.Web.UI.RadWindowUtils' doesnt seems to be available in Telerik.Web.UI assembly. Can you shed more light on this please.

Thanks

 

0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Jun 2009, 07:06 AM
Hi Raja,

Here is the code that I tried in order to localize the button text.

 
<form id="form1" runat="server"
<div> 
<telerik:RadWindowManager ID="RadWindowManager1" Skin="Black" runat="server"
</telerik:RadWindowManager> 
<input id="Button1" type="button" value="Show Alert" onclick="ShowRadAlert();" /> 
 
<script type="text/javascript"
    Telerik.Web.UI.RadWindowUtils.Localization =     
    {    
        "Close" : "Close",    
        "Minimize" : "Minimize",    
        "Maximize" : "Maximize",    
        "Reload" : "Reload",    
        "PinOn" : "Pin on",    
        "PinOff" : "Pin off",    
        "Restore" : "Restore",    
        "OK" : "My text",    
        "Cancel" : "Cancel",    
        "Yes" : "Yes",    
        "No" : "No"      
    }; 
function ShowRadAlert() 
    radalert('Sample alert to show customized button text'); 
 
</script> 
</div> 
</form> 

-Shinu.
0
Georgi Tunev
Telerik team
answered on 05 Jun 2009, 10:50 AM
Hi Raja,

The code that Shinu posted is not server-side code - this is a JavaScript function that should be placed in your aspx file.

All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Raja
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Raja
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or