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

Change Yes and No Buttons on radconfirm prompt

4 Answers 558 Views
Window
This is a migrated thread and some comments may be shown as answers.
Aret
Top achievements
Rank 1
Aret asked on 10 Jan 2013, 05:10 AM
Greetings,

Before I state my quesiton, I want to make it clear that I am using a very old version of the Rad Controls or in other words I do not have the latest RadConrols asp.net ajax. With that being said, the issue I am having is being able to change the text of my yes and no buttons on my rad confirm dialog box. Currently this is how I am calling my rad confirm and everything is working. 

VB.NET code that calls the radconfirm

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

 radAjax.ResponseScripts.Add("radconfirm('Your answers have been submitted.', callBack,  290, 110, '', 'Answers Submitted');")

End Sub



ASP Page code:

    function callBack(args) {

         if (args) {

             document.getElementById('<%= btnRedirect.ClientID %>').click();

         }
     }


  <div>
  <asp:Button ID="btnRedirect" OnClick="btnRedirect_Click" runat="server" Text="" />
  </div>


  <radW:RadWindowManager ID="RadWindowManager1"  EnableShadow="true" runat="server">
  </radW:RadWindowManager>




How would I be able to change the text in my radconfirm, by still using this method in calling my prompt.....?

I also found a localization file under my radcontrols folder which is an XML file that display this information:

<?xml version="1.0" encoding="utf-8" ?>
<localization>
    <string id="Maximize">Maximize</string>
    <string id="Minimize">Minimize</string>
    <string id="Close">Close</string>
    <string id="Restore">Restore</string>    
    <string id="PinOff">Pin Off</string>
    <string id="PinOn">Pin On</string>
    <string id="ConfirmMessage">Are you sure?</string>
    <string id="PromptMessage">Enter value:</string>
    <string id="Ok">Ok</string>
    <string id="Cancel">Cancel</string>
    <string id="Yes">Yes</string>
    <string id="No">No</string>
    <string id="Loading">Loading...</string>
    <string id="Reload">Reload</string>    
    <string id="Alert">RadWindow alert</string>
    <string id="Prompt">RadWindow prompt</string>
    <string id="Confirm">RadWindow confirm</string>    
</localization>


I do not want to change the Text in this file because it would then affect all my rad confirm prompts on my other web pages.


4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Jan 2013, 06:10 AM
Hi Aret,

Try the following code snippet to achieve your scenario.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" EnableShadow="true" runat="server"  Localization-OK="confirm" Localization-Cancel="don't confirm">
</telerik:RadWindowManager>

Hope this helps.

Regards,
Princy.
0
Aret
Top achievements
Rank 1
answered on 10 Jan 2013, 11:46 AM
I just tried that code snippet and it does not work.  Is there another way.
0
Aret
Top achievements
Rank 1
answered on 11 Jan 2013, 04:47 AM
It seems I have the ASP.NET Classic controls from Telerik.  Does not seem like there is any such thing as a Localization property for any of my Telerik controls.
0
Princy
Top achievements
Rank 2
answered on 11 Jan 2013, 06:28 AM
Hi,

Unfortunately I cannot replicate the issue at my end. Try changing the text as shown below.
JS:
Telerik.Web.UI.RadWindowUtils.Localization = 
{
    "OK" : "confirm",
    "Cancel" : "don't confirm"
};
Also check the following help documentation.
Changing the localization of RadWindow for ASP.NET AJAX

Regards,
Princy.
Tags
Window
Asked by
Aret
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Aret
Top achievements
Rank 1
Share this question
or