Monday, January 14, 2013

Telerik Tricks: Radconfirm With Yes No Buttons

Radconfirm modal dialog box contains OK button and Cancel button to get user confirmation. There are several ways can use to change the localization settings of the radconfirm controller’s inner text. One is change localization settings using resource file. Changing localization settings using RadWindowManager is another way to change the inner text of radconfirm.

Following code snippets shows how change radconfirm localization settings using RadWindowManager


    



Following code snippet illustrate the way to change radconfirm localization using JavaScript

    Telerik.Web.UI.RadWindowUtils.Localization =   
    {    
        "OK" : "OK",  
        "Cancel" : "Cancel" 
    };


The main drawback of previously mentioned methodologies is it changes the localization settings of all radconfirm, radalerts and radwindows. To overcome that issue, need to change localization settings of specific radconfirm without effecting other radconfirm dialogs, radalerts and radwindows. Following trick can use to change the localization settings of specific radconfirm. It changes the localization settings before display the radconfirm and it change again localization settings to defaults immediate after the radconfirm get disappear.

 


2 comments: