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

Radalert "OK" Button at right side

4 Answers 197 Views
Window
This is a migrated thread and some comments may be shown as answers.
Pritesh
Top achievements
Rank 1
Pritesh asked on 02 Aug 2010, 07:10 AM
Hello Sir/Madam

I have radalert in my code, and by default "OK" button display at Left side of radalert window.
as i want to display button at right side.
and while doing that my window size should be not change.
can you suggest me about this.

Thanks
Pritesh

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Aug 2010, 08:44 AM
Hello,

It is very easy to customize radconfirm using ConfirmTemplate, of RadWindowManager.
Changing the Dialog Templates

Just change the order of the buttons in ConfirmTemplate to show OK button at right side.


-Shinu.
0
Pritesh
Top achievements
Rank 1
answered on 03 Aug 2010, 02:18 PM
HI Shinu,

Thanks for the Reply,

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<
AlertTemplate>
<
div class="rwDialogPopup radalert">   
<div class="rwDialogText">
{
1}    
</div>

<div>
 
<a  onclick="$find('{0}').close();"
 
class="rwPopupButton" href="javascript:void(0);">
  
<span class="rwOuterSpan">
   
<span class="rwInnerSpan">##LOC[OK]##</span>
  
</span>
 
</a>    
</div>
</
div>
</
AlertTemplate>
<
PromptTemplate>
<
div class="rwDialogPopup radprompt">   
   
<div class="rwDialogText">
   {
1}    
   
</div>  
   
<div>
    
<script type="text/javascript">
    
function RadWindowprompt_detectenter(id, ev, input)
    {       
     if (!ev) ev = window.event;                
     if (ev.keyCode == 13)
     {                       
         var but = input.parentNode.parentNode.getElementsByTagName("A")[0];             
         if (but)
      {       
       if (but.click) but.click();
       else if (but.onclick)
       {
           but.focus(); var click = but.onclick; but.onclick = null; if (click) click.call(but);        
       }
      }
        return false;
     }
     else return true;
    }  
    
</script>
    
<input  onkeydown="return RadWindowprompt_detectenter('{0}', event, this);" type="text"  class="rwDialogInput" value="{2}" />
   
</div>
   
<div>
    
<a onclick="$find('{0}').close(this.parentNode.parentNode.getElementsByTagName('input')[0].value);"    
     
class="rwPopupButton" href="javascript:void(0);" ><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[OK]##</span></span></a>
    
<a onclick="$find('{0}').close(null);" class="rwPopupButton"  href="javascript:void(0);"><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Cancel]##</span></span></a>
   
</div>
</
div>
</
PromptTemplate>
<
ConfirmTemplate>
<
div class="rwDialogPopup radconfirm">   
<div class="rwDialogText">
{
1}    
</div>      
<div>
 
<a onclick="$find('{0}').close(true);"  class="rwPopupButton" href="javascript:void(0);" ><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[OK]##</span></span></a>
 
<a onclick="$find('{0}').close(false);" class="rwPopupButton"  href="javascript:void(0);"><span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Cancel]##</span></span></a>
</div>
</
div>
</
ConfirmTemplate>
</
telerik:RadWindowManager>




After using this Code to my Project i got Error Undefined Class, all where-ever i declare in <div> tag
as i have Q3 2009 of telerik version.

So please give me Example by that i can Shift "OK" button at Right Side
and Not effect to Radalert Window.

Thanks
0
Shinu
Top achievements
Rank 2
answered on 03 Aug 2010, 02:51 PM
Hi Pritesh,


See the following aspx mark-up which helps you to move the OK button to right side.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <ConfirmTemplate>
        <div class="rwDialogPopup radconfirm">
            <div class="rwDialogText">
                {1}
            </div>
            <div>
                <a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);">
                    <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Cancel]##</span></span></a>
                <a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);">
                    <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[OK]##</span></span></a>
            </div>
        </div>
    </ConfirmTemplate>
</telerik:RadWindowManager>



-Shinu.
0
Pritesh
Top achievements
Rank 1
answered on 04 Aug 2010, 07:10 AM
Hi Shinu,
I tried your code but not get my result, below write my code please suggest me where i m wrong.
please reply me ASAP.
Thanks
<%@ Page Title="" Language="C#" MasterPageFile="~/UI/ddient.Master" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="ePlannerPro2Client.UI.Test" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
    function confirm() {
         
var oWnd = radalert("End-Date Should be Later than Start-Date",300,100);
 
 
}
</script>
<telerik:RadAjaxManagerProxy ID="RadAppAjaxProxy" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btn1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="btn1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Transparency="80" InitialDelayTime="0"
    runat="server" BackgroundPosition="Center" />
<asp:Button ID="btn1" runat="server" OnClientClick="confirm()" Text="submit" />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <ConfirmTemplate>
        <div class="rwDialogPopup radconfirm">
            <div class="rwDialogText">
                {1}
            </div>
            <div>
                <a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);">
                    <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Cancel]##</span></span></a>
                <a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);">
                    <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[OK]##</span></span></a>
            </div>
        </div>
    </ConfirmTemplate>
</telerik:RadWindowManager>
 
</asp:Content>

 
Tags
Window
Asked by
Pritesh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pritesh
Top achievements
Rank 1
Share this question
or