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

setting the position of window

3 Answers 71 Views
Window
This is a migrated thread and some comments may be shown as answers.
Webster Velasco
Top achievements
Rank 2
Webster Velasco asked on 08 Jan 2010, 09:29 AM
hi

how can i set the position of my pop up window?
i mean place where it should be appear

thanks in advance

regards
webster

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Jan 2010, 10:47 AM
Hello,

Use the Top and Left properties to specify the position of the window relative to the HTML page. Top and Left give the offset, in pixels, of the top left corner of the window. Checkout the following documentation for more information.
Showing and Positioning

-Shinu.
0
Webster Velasco
Top achievements
Rank 2
answered on 11 Jan 2010, 10:38 AM
your answer didnt solve my problem..

here is the script..

bc i want to make it work in IE8 because in Firefox it seems to work

main page
<%@ Page Language="vb" CodeFile="RicezioneDocumento.aspx.vb" AutoEventWireup="false" Inherits="WebBIO.Operativita.RicezioneDocumento.RicezioneDocumentoDefault" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<%@ Register Src="UserControls/RicezioneDocDati.ascx" TagName="Dati" TagPrefix="rdd" %> 
 
<form runat="server" id="frmRicezioneDoc"
 
    <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
 
    <div> 
     
        <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" IsSticky="true"
     </telerik:RadAjaxLoadingPanel>         
        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="LoadingPanel1"
            <div style="float:left; width:800px"
                <telerik:RadTabStrip ID="rtsRicezioneDoc" SelectedIndex="0" runat="server" MultiPageID="rmpRicezioneDoc" Skin="Vista" CssClass="tabStrip" /> 
                <telerik:RadMultiPage ID="rmpRicezioneDoc" runat="server" SelectedIndex="0" CssClass="multiPage" /> 
            </div> 
             
            <div style="float:left; width:800px"
                <rdd:Dati id="ControlloDati" runat="server" /> 
            </div> 
       </telerik:RadAjaxPanel>      
         
    </div> 
</form> 

user control
<%@ Control Language="vb" CodeFile="SelezioneModello.ascx.vb" Inherits="WebBIO.Operativita.RicezioneDocumento.SelezioneModello" AutoEventWireup="false" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
   <script type="text/javascript"
        function Set_Cookie(nomeCookie, value, expires, path, domain, secure ) 
        { 
            // set time, it's in milliseconds 
            var today = new Date(); 
            today.setTime( today.getTime() ); 
 
            /* 
            if the expires variable is set, make the correct 
            expires time, the current script below will set 
            it for x number of days, to make it for hours, 
            delete * 24, for minutes, delete * 60 * 24 
            */ 
            if ( expires ) 
            { 
            expiresexpires = expires * 60 * 1000; 
            } 
            var expires_date = new Date( today.getTime() + (expires) ); 
 
            document.cookie = nomeCookie + "=" + unescape(value) + 
            ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
            ( ( path ) ? ";path=" + path : "" ) + 
            ( ( domain ) ? ";domain=" + domain : "" ) + 
            ( ( secure ) ? ";secure" : "" ); 
        } 
 
         function OpenWin(controlloCodice) 
            { 
               var value = null
               var controllo = $find('<%=txtMODELLO.ClientID %>'); 
               var cmdSQL = ""
                
               if (controllo != null) { 
                   value = controllo.get_value(); 
                    
                   if (value != null){ 
                        if (String(value).substring(0, 1) == "?") { 
                            cmdSQL  = "CODICE LIKE = '%" + escape(String(value).substring(1)) +"%'"; 
                        }; 
                   }; 
                }; 
                                
               Set_Cookie("cookCampoFiltro", escape(cmdSQL), 5, '/', '', '' ); 
               Set_Cookie("cookZoomSP", "Modulistica_Zoom", 5, '/', '', '' ); 
               Set_Cookie("cookNomeControllo", controlloCodice, 5, '/', '', '' ); 
                
               var oWnd2 = radopen("ZoomSTD.aspx", "rwdSelMod");           
            }; 
             
             
         function OnClientClose(sender, args) { 
                //var arg = eventArgs.split("|") 
                 
                //alert("chiudo"); 
                // valori: 
                // 0 --> NomeSP 
                // 1 --> Codice Ritorno 
                // 2 --> Descrizione Ritorno 
                // 3 --> Quale Controllo da Valorizzare 
                 
                var arg = args.get_argument(); 
                var QualeControllo;  
                var QualeLabel; 
                                 
                if(arg != null){ 
                    var oArg = arg.Oggetto.split("|"); 
                    QualeControllo = document.getElementById("<%= txtMODELLO.ClientID %>"); 
                    QualeLabel = document.getElementById("<%= MODELLO_Descr.ClientID %>"); 
                    QualeControllo.value = oArg[1]; 
                    QualeLabel.value = oArg[2]; 
                    
                } 
            }     
             
    </script>      
 
<telerik:RadWindowManager ID="rwmSelezioneModello" runat="server" Skin="Vista"
    <Windows> 
        <telerik:RadWindow runat="server" Title="WebBIO Zoom" Animation="FlyIn" ReloadOnShow="True"   
            ID="rwdSelMod" Modal="True" OffsetElementID="cmdMODELLOZOOM" Width="500px" Height="600px" OnClientClose="OnClientClose" Behavior="Close,Move" InitialBehavior="None"  Left="200px" Top="600px"/> 
    </Windows> 
</telerik:RadWindowManager> 
 
 
<table border = "0" width="98%" > 
    <tr> 
        <td colspan="2"><asp:Label runat="Server" ID="titleLabel" Text="Selezionare il Documento" /></td
    </tr> 
 
    <tr> 
        <td> 
            <asp:TextBox runat="Server" ID="txtMODELLO" Width="150" /> 
            <asp:ImageButton runat="server" ID="cmdMODELLOZOOM" ImageUrl="../_img/lens.gif" OnClientClick="OpenWin('txtMODELLO');  return false;"  /> 
        </td> 
        <td><asp:TextBox runat="Server" ID="MODELLO_Descr" Enabled="false" Width="500" /></td
    </tr> 
     
    <tr><td colspan="2"><hr /></td></tr> 
 
    <tr> 
        <td colspan="2"><asp:Button runat="Server" ID="cmdAvanti" Text="Avanti" OnClick="cmdAvanti_Click" /></td
    </tr> 
 
 
</table> 



0
Svetlina Anati
Telerik team
answered on 11 Jan 2010, 12:14 PM
Hi Webster,

I noticed that you RadWindow is modal and indeed, by default the when a RadWindow is modal, it is shown in the middle of the screen and this is by design. The RadWindow control is intended to replace the standard popup wndows called with window.showModalDialog and all the modal standard windows are always shown at the center of the screen and thus the RadWindow is implemented to behave the same way.

In order to get the desired result, you can use the moveTo(x, y) method of the RadWindow once you have shown it - this will make it position at the desired coordinates.

I hope that my explanations and suggestion are helpful, let me know how it goes and in case you need further assistance or you have additional questions.




Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Webster Velasco
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Webster Velasco
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or