Radalert "OK" Button at right side

5 posts, 0 answers
  1. Pritesh
    Pritesh avatar
    4 posts
    Member since:
    Aug 2010

    Posted 02 Aug 2010 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Aug 2010 Link to this post

    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.
  3. Pritesh
    Pritesh avatar
    4 posts
    Member since:
    Aug 2010

    Posted 03 Aug 2010 Link to this post

    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
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Aug 2010 Link to this post

    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.
  5. Pritesh
    Pritesh avatar
    4 posts
    Member since:
    Aug 2010

    Posted 04 Aug 2010 Link to this post

    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>

     
Back to Top