Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Radwindow Position
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Radwindow Position

Feed from this thread
  • Posted on Mar 1, 2007 (permalink)

    Hi,

    I have RadGrid, With one column as Hyperlink, I want to show Radwindow at the position of the Hyperlink columns in the Grid


    Dhananjay

  • Valentin.Stoychev Valentin.Stoychev admin's avatar

    Posted on Mar 2, 2007 (permalink)

    Hello Dhananjay,

    Please see this example:
    http://www.telerik.com/demos/aspnet/Window/Examples/ShowAndPosition/DefaultCS.aspx

    Best wishes,
    Valentin.Stoychev
    the telerik team

  • Posted on Mar 5, 2007 (permalink)

    But how can we do this dynamically? For instance, I have a stactic HTML control:

    <a href="#" onclick="return ShowRecipHelp('01');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a>

    A simple image within an anchor, I have these everywhere on the page, but how would I be able to dynamically set the OffSetElementId? I don't want to have to name all the img control and have several window control on a page.

    <radw:RadWindowManager ID="RadWindowManager1" runat="server" VisibleStatusbar="False">

    <Windows>

    <radw:RadWindow ID="RecipHelpWindow" runat="server" Height="350px" Width="350px" NavigateUrl="">

    </Windows>

    </radw:RadWindowManager>



    Thanks!

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Mar 6, 2007 (permalink)

    Hi Robert,

    Basically, to position the RadWindow dynamically on the client you will need to use either the SetOffsetElementId() method or the MoveTo() method.
    The first one requires the id of the element by which you want to position the window and the second one requires the top and left coordinates for the element. Which one of the 2 approaches you will choose, depends on the requirements of your scenario.

    My advice is to implement the desired functionality by using a standard browser's popup (opened with window.open). Once you achieve this, you should not have problems replacing window.open with window.radopen. If you experience problems converting to RadWindow, send us the project and we will help.



    Greetings,
    Georgi Tunev
    the telerik team

  • Posted on Mar 7, 2007 (permalink)

    Thanks, for the reply, I will provide you with some code on the form to show what I mean in detail.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="residential_listing_form_6.aspx.vb" Inherits="Residential_Listing_form_6" %> 
    <%@ Register TagPrefix="radw" Namespace="Telerik.WebControls" Assembly="RadWindow.Net2" %> 
    <%@ Register TagPrefix="sesCheck" TagName="SessionCheck" Src="~/security/session_check.ascx"%> 
    <sesCheck:SessionCheck id="SessionCheck" runat="server"></sesCheck:SessionCheck><% 'End Security %> 
    <%@ Register TagPrefix="sec" TagName="Security" Src="~/security/memberlogin_security.ascx" %> 
    <sec:Security id="SecurityCheck" runat="server"></sec:Security><% 'End Security %> 
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
    <HTML> 
    <HEAD> 
    <TITLE>Residential Listing Form Page 6 of 10 - Pacific West Association of REALTORS&reg;</TITLE> 
    <META NAME="description" CONTENT="">  
    <META NAME="keywords" CONTENT="">  
    <META NAME="author" CONTENT="Pacific West Association of REALTORS&reg;">  
    <!-- #Include Virtual="/template/genericscripts.ascx" --><% 'Contains generic scripts used on all pages %> 
    <link href="/css/menu.css" rel="stylesheet" type="text/css"><% 'CSS for topbar %> 
    <link href="/css/layout1.css" rel="stylesheet" type="text/css"><% 'CSS for 1 column layout %> 
    <link href="/css/textstyles.css" rel="stylesheet" type="text/css"><% 'CSS for basic text %> 
    <link href="/css/custom.css" rel="stylesheet" type="text/css"><% 'CSS for PWAOR custom text %> 
    <script type="text/javascript">  
        //Triggers the RadWindow to open the form page with dynamic string  
        function ShowRecipHelp(id)  
            {  
                window.radopen("RecipFormHelp.aspx?question_help=" + id, "RecipHelpWindow");  
                return false;   
            }      
    </script> 
    </HEAD> 
    <BODY> 
    <div class="wrapper">  
    <div><img src="/template/headerimages/header_generic.jpg" width="780" height="100" alt=""></div><br>      
    <div class="container"><img src="/template/backgroundboxes/1column_top.gif" width="768" height="9" alt=""><div class="center">  
    <div class="maintitle">Residential Listing Form - Page 6 of 10</div><br /><br /> 
    <i>Fields marked with an <span class="errortext">*</span> are required.</i> 
    <form id="form2" method="post" runat="server">  
    <radw:RadWindowManager ID="RadWindowManager1" runat="server" VisibleStatusbar="False">  
        <Windows> 
            <radw:RadWindow ID="RecipHelpWindow" runat="server" Height="350px" Width="350px"/>  
        </Windows> 
    </radw:RadWindowManager>   
    <table width="700">  
        <tr> 
            <td align="center"><asp:Label ID="alert_messages" runat="server" CssClass="errortext"></asp:Label></td>  
        </tr> 
    </table> 
    <asp:Table ID="page_four_tbl" runat="server" Width="700" CellSpacing="2" CellPadding="4" BorderWidth="1">  
        <asp:TableRow> 
            <asp:TableCell> 
                <asp:Table ID="Table1" runat="server" Width="700" CellSpacing="2" CellPadding="4" BorderWidth="0">  
                    <asp:TableRow> 
                        <asp:TableCell Width="135">School District<span class="errortext"> *<br /><asp:RequiredFieldValidator ID="school_district_validate" runat="server" ControlToValidate="school_district" Display="Dynamic" EnableClientScript="true" ErrorMessage="Select School District." InitialValue="" SetFocusOnError="true"></asp:RequiredFieldValidator></span></asp:TableCell> 
                        <asp:TableCell> 
                            <asp:DropDownList ID="school_district" runat="server" ToolTip="Choose school district">  
                                <asp:ListItem Value="" Text="(Select)"></asp:ListItem> 
                                <asp:ListItem Value="Elementary School" Text="Elementary School"></asp:ListItem> 
                                <asp:ListItem Value="JR High" Text="JR High"></asp:ListItem> 
                                <asp:ListItem Value="SR High" Text="SR High"></asp:ListItem> 
                            </asp:DropDownList> 
                            &nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('78');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a>  
                        </asp:TableCell> 
                    </asp:TableRow> 
                </asp:Table> 
                <asp:Table ID="Table2" runat="server" Width="700" CellSpacing="2" CellPadding="4" BorderWidth="0">  
                    <asp:TableRow> 
                        <asp:TableCell Width="135">Association Amenities</asp:TableCell> 
                        <asp:TableCell Width="310">  
                            <asp:CheckBoxList ID="association_amenities" runat="server" BorderWidth="1" RepeatColumns="2" RepeatDirection="Vertical" RepeatLayout="Table" ToolTip="Association amenities">  
                                <asp:ListItem Text="Assos BBQ" Value="Assos BBQ"></asp:ListItem> 
                                <asp:ListItem Text="Assos Club House/Rec Fac" Value="Assos Club House/Rec Fac"></asp:ListItem> 
                                <asp:ListItem Text="Assos Earthquake Ins Pd" Value="Assos Earthquake Ins Pd"></asp:ListItem> 
                                <asp:ListItem Text="Assos Gym/Exercise Rm." Value="Assos Gym/Exercise Rm."></asp:ListItem> 
                                <asp:ListItem Text="Assos Inur Paid" Value="Assos Inur Paid"></asp:ListItem> 
                                <asp:ListItem Text="Assos Maint Paid" Value="Assos Maint Paid"></asp:ListItem> 
                                <asp:ListItem Text="Assos Pet Rules - Call LA" Value="Assos Pet Rules - Call LA"></asp:ListItem> 
                                <asp:ListItem Text="Assos Pool" Value="Assos Pool"></asp:ListItem> 
                                <asp:ListItem Text="Assos Sauna" Value="Assos Sauna"></asp:ListItem> 
                                <asp:ListItem Text="Assos Sport Court" Value="Assos Sport Court"></asp:ListItem> 
                                <asp:ListItem Text="Assos Tennis" Value="Assos Tennis"></asp:ListItem> 
                                <asp:ListItem Text="Assos Trash Paid" Value="Assos Trash Paid"></asp:ListItem> 
                                <asp:ListItem Text="Assos Utilities Paid" Value="Assos Utilities Paid"></asp:ListItem> 
                                <asp:ListItem Text="Prvt & Assoc Pool" Value="Prvt & Assoc Pool"></asp:ListItem> 
                                <asp:ListItem Text="Prvt & Assoc Spa" Value="Prvt & Assoc Spa"></asp:ListItem> 
                                <asp:ListItem Text="Senior Comm" Value="Senior Comm"></asp:ListItem> 
                            </asp:CheckBoxList> 
                        </asp:TableCell> 
                        <asp:TableCell>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('79');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                </asp:Table> 
                <asp:Table ID="Table3" runat="server" Width="700" CellSpacing="2" CellPadding="4" BorderWidth="0">  
                    <asp:TableRow> 
                        <asp:TableCell Width="135">Assoc Dues #1<span class="errortext"> *<br /> 
                            <asp:RequiredFieldValidator ID="assoc_dues_1_validate" runat="server" ControlToValidate="assoc_dues_1" Display="Dynamic" EnableClientScript="true" ErrorMessage="Enter Association Dues #1." SetFocusOnError="true"></asp:RequiredFieldValidator> 
                            <asp:RegularExpressionValidator ID="assoc_dues_1_expression" runat="server" ControlToValidate="assoc_dues_1" Display="Dynamic" EnableClientScript="true" ErrorMessage="Use Only Numbers." SetFocusOnError="true" ValidationExpression="\d{3}"></asp:RegularExpressionValidator> 
                        </span></asp:TableCell> 
                        <asp:TableCell>$&nbsp;<asp:TextBox ID="assoc_dues_1" runat="server" Columns="3" MaxLength="3" ToolTip="Enter association dues amount"></asp:TextBox>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('80');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                    <asp:TableRow> 
                        <asp:TableCell Width="135">Assoc Dues #2</asp:TableCell> 
                        <asp:TableCell>$&nbsp;<asp:TextBox ID="assoc_dues_2" runat="server" Columns="3" MaxLength="3" ToolTip="Enter association dues amount (optional)"></asp:TextBox>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('81');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                    <asp:TableRow> 
                        <asp:TableCell Width="135"># of Units<span class="errortext"> *<br /> 
                            <asp:RequiredFieldValidator ID="number_units_" runat="server" ControlToValidate="number_of_units" Display="Dynamic" EnableClientScript="true" ErrorMessage="Enter Number of Units." SetFocusOnError="true"></asp:RequiredFieldValidator> 
                            </span> 
                        </asp:TableCell> 
                        <asp:TableCell><asp:TextBox ID="number_of_units" runat="server" Columns="2" MaxLength="2" ToolTip="Enter number of units"></asp:TextBox>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('82');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                </asp:Table> 
                <asp:Table ID="Table4" runat="server" Width="700" CellSpacing="2" CellPadding="4" BorderWidth="0">  
                    <asp:TableRow> 
                        <asp:TableCell Width="135">Terms</asp:TableCell> 
                        <asp:TableCell Width="485">  
                            <asp:CheckBoxList ID="terms" runat="server" BorderWidth="1" RepeatColumns="3" RepeatDirection="Vertical" RepeatLayout="Table" ToolTip="Select terms">  
                                <asp:ListItem Text="All Inclusive Trust Deed" Value="All Inclusive Trust Deed"></asp:ListItem> 
                                <asp:ListItem Text="Cal Vet" Value="Cal Vet"></asp:ListItem> 
                                <asp:ListItem Text="Cash" Value="Cash"></asp:ListItem> 
                                <asp:ListItem Text="Cash To Existing Loan" Value="Cash To Existing Loan"></asp:ListItem> 
                                <asp:ListItem Text="Cash To New Loan" Value="Cash To New Loan"></asp:ListItem> 
                                <asp:ListItem Text="Exchange" Value="Exchange"></asp:ListItem> 
                                <asp:ListItem Text="Fannie Mae" Value="Fannie Mae"></asp:ListItem> 
                                <asp:ListItem Text="FHA Loan" Value="FHA Loan"></asp:ListItem> 
                                <asp:ListItem Text="Freddie Mac" Value="Freddie Mac"></asp:ListItem> 
                                <asp:ListItem Text="Land Contract" Value="Land Contract"></asp:ListItem> 
                                <asp:ListItem Text="Lse-Opt To Buy" Value="Lse-Opt To Buy"></asp:ListItem> 
                                <asp:ListItem Text="Owner May Carry" Value="Owner May Carry"></asp:ListItem> 
                                <asp:ListItem Text="Owner Will Carry" Value="Owner Will Carry"></asp:ListItem> 
                                <asp:ListItem Text="Real Estate Owned" Value="Real Estate Owned"></asp:ListItem> 
                                <asp:ListItem Text="Short Pay/Subject To Lender" Value="Short Pay/Subject To Lender"></asp:ListItem> 
                                <asp:ListItem Text="Subject To Court" Value="Subject To Court"></asp:ListItem> 
                                <asp:ListItem Text="Subject To Other" Value="Subject To Other"></asp:ListItem> 
                                <asp:ListItem Text="Submit" Value="Submit"></asp:ListItem> 
                                <asp:ListItem Text="Trade" Value="Trade"></asp:ListItem> 
                                <asp:ListItem Text="Trust Conveyance" Value="Trust Conveyance"></asp:ListItem> 
                                <asp:ListItem Text="VA Loan" Value="VA Loan"></asp:ListItem> 
                                <asp:ListItem Text="VA No Loan" Value="VA No Loan"></asp:ListItem> 
                                <asp:ListItem Text="VA No No Loan" Value="VA No No Loan"></asp:ListItem> 
                                <asp:ListItem Text="None" Value="None"></asp:ListItem> 
                            </asp:CheckBoxList> 
                        </asp:TableCell> 
                        <asp:TableCell>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('83');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                </asp:Table> 
                <asp:Table ID="Table5" runat="server" Width="700" CellSpacing="2" CellPadding="4" BorderWidth="0">  
                    <asp:TableRow> 
                        <asp:TableCell Width="135">1st TD Amount</asp:TableCell> 
                        <asp:TableCell><asp:TextBox ID="first_td_amt" runat="server" Columns="6" MaxLength="6" ToolTip="Enter 1st tax deductable amount"></asp:TextBox>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('84');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                    <asp:TableRow> 
                        <asp:TableCell Width="135">Interest Rate</asp:TableCell> 
                        <asp:TableCell><asp:TextBox ID="interest_rate" runat="server" Columns="4" MaxLength="4" ToolTip="Enter first interest rate"></asp:TextBox>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('85');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                    <asp:TableRow> 
                        <asp:TableCell Width="135">2nd TD Amount</asp:TableCell> 
                        <asp:TableCell><asp:TextBox ID="second_td_amt" runat="server" Columns="6" MaxLength="6" ToolTip="Enter 2nd tax deductable amount"></asp:TextBox>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('86');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                    <asp:TableRow> 
                        <asp:TableCell Width="135">Interest Rate 2</asp:TableCell> 
                        <asp:TableCell><asp:TextBox ID="interest_rate_2" runat="server" Columns="4" MaxLength="4" ToolTip="Enter second interest rate"></asp:TextBox>&nbsp;&nbsp;<href="#" onclick="return ShowRecipHelp('87');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a></asp:TableCell> 
                    </asp:TableRow> 
                </asp:Table> 
                <asp:Table runat="server">    
                    <asp:TableRow> 
                        <asp:TableCell ColumnSpan="3">&nbsp;</asp:TableCell>    
                    </asp:TableRow> 
                </asp:Table> 
            </asp:TableCell> 
        </asp:TableRow> 
    </asp:Table> 
    <asp:Table ID="prev_next_tbl" runat="server" Width="710">  
        <asp:TableRow> 
            <asp:TableCell><asp:Button ID="back_btn" runat="server" CausesValidation="false" Text="<< Back" /></asp:TableCell> 
            <asp:TableCell HorizontalAlign="Right">  
                <asp:Button ID="save_incomplete_page5_btn" runat="server" CausesValidation="false" Text="Save As Incomplete" />          
            </asp:TableCell> 
            <asp:TableCell HorizontalAlign="Right">  
                <asp:Button ID="SavePage5_btn" runat="server" Text="Save & Continue >>" /> 
                <asp:HiddenField ID="queue_id_hdn" runat="server" /> 
                <asp:HiddenField ID="member_id_hdn" runat="server" /> 
                <asp:HiddenField ID="mls_id_hdn" runat="server" /> 
            </asp:TableCell> 
        </asp:TableRow> 
    </asp:Table> 
    </form> 
    <asp:SqlDataSource id="sqlUpsertResidentialForm" runat="server" ConnectionString="<%$ connectionStrings:connectionstring %>" ProviderName="System.Data.SqlClient"></asp:SqlDataSource> 
    <asp:SqlDataSource ID="sqlGetIncompleteRecipQueueItems" runat="server" ConnectionString="<%$ connectionStrings:connectionstring %>" ProviderName="System.Data.SqlClient"></asp:SqlDataSource> 
    </div><% 'end center box %> 
    <img src="/template/backgroundboxes/1column_bot.gif" width="768" height="10" alt=""></div> 
    <div class="wide bottom clear"><!-- #Include Virtual="/template/genericfooter.ascx" --></div>  
    </div>   
    </BODY> 
    </HTML> 
     

    I want to be able to dynamically set each image tag as the offset element

    <href="#" onclick="return ShowRecipHelp('83');"><img border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a>

    Any help would be great!

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Mar 8, 2007 (permalink)

    Hello Robert,

    The problem is not directly related to the r.a.d.window control. The main point here is that in any case (r.a.d.window or browser's popup) you will need to get a reference to these images in some way. That is why you will need to add an ID property to them. After that just set the appropriate ID in the SetOffsetElementId() method.




    Greetings,
    Georgi Tunev
    the telerik team

  • Posted on Mar 8, 2007 (permalink)

    Ya, I understand that, I guess I am just looking for a way to dynamically feed the id of the image object when it is clicked to set the OffsetElementId property

    <a href="#" onclick="return ShowRecipHelp('78');"><img id="help1" runat="server" border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" />

    <a href="#" onclick="return ShowRecipHelp('78');"><img id="help2" runat="server" border="0" src="/_Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" />

    and ect., but this is more of my issue to resolve on the code behind. Thanks!

  • Morten Intermediate avatar

    Posted on Mar 10, 2007 (permalink)

    Hi binici

    check out "Binding to a grid - Opening Windows by Clicking Grid Items" in the rad window v1.7 help file:

    With this you should be able to:
    - have only one RadWindow in my RadWindowManager (helptext.aspx),
    - be able to pass a querystring param (helptext.aspx?id=2, helptext.aspx?id=3) from the calling element (image/button/link),
    - have the opened RadWindow re-position to the position of the calling element

    Morten

    Calling page:
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server">  
     
      <title>Re-Pos window</title> 
        
      <script> 
        
      function OpenPositionedWindow(calling_element, url, windowName)  
      {  
          var oWnd = window.radopen(url, windowName);  
          var oPos = GetTopLeftPosition(calling_element);  
          oWnd.MoveTo(oPos.x + parseInt(calling_element.clientWidth) + 15, oPos.y + 20);  
      }  
     
      function GetTopLeftPosition(el)  
      {  
          var left = 0;  
          var top = 0;  
     
          while (el.offsetParent)  
          {  
              left += el.offsetLeft;  
              top += el.offsetTop;  
              elel = el.offsetParent;  
          }  
          if (el.x) left = el.x;  
          if (el.y) top = el.y;  
          var oPos = new Object();  
          oPos.x = left;  
          oPos.y = top;  
          return oPos;  
      }  
        
      </script>   
          
    </head> 
     
    <body> 
      <form id="form1" runat="server">  
        <div> 
     
          <asp:Image runat="server" ID="Image1" ImageUrl="~/images/help.gif" /><br /> 
          <asp:Image runat="server" ID="Image2" ImageUrl="~/images/help.gif" /><br /> 
          <asp:Image runat="server" ID="Image3" ImageUrl="~/images/help.gif" /><br /> 
          <asp:Image runat="server" ID="Image4" ImageUrl="~/images/help.gif" /><br /> 
          <asp:Image runat="server" ID="Image5" ImageUrl="~/images/help.gif" /> 
     
          <radW:RadWindowManager id="RadWindowManager1" runat="server">  
            <windows> 
              <radW:RadWindow id="ToolTip" Runat="server" Width="500px" Height="400px"></radW:RadWindow> 
            </windows> 
           </radW:RadWindowManager> 
            
        </div> 
      </form> 
    </body> 
    </html> 
     

    Code behind of calling page:
      Private Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
     
        If Not Page.IsPostBack Then 
          Image1.Attributes.Add("onclick"String.Format("OpenPositionedWindow(this,'WebForm4.aspx?HelpTextId={0}','{1}');", 1, "ToolTip"))  
          Image2.Attributes.Add("onclick"String.Format("OpenPositionedWindow(this,'WebForm4.aspx?HelpTextId={0}','{1}');", 2, "ToolTip"))  
          Image3.Attributes.Add("onclick"String.Format("OpenPositionedWindow(this,'WebForm4.aspx?HelpTextId={0}','{1}');", 3, "ToolTip"))  
          Image4.Attributes.Add("onclick"String.Format("OpenPositionedWindow(this,'WebForm4.aspx?HelpTextId={0}','{1}');", 4, "ToolTip"))  
          Image5.Attributes.Add("onclick"String.Format("OpenPositionedWindow(this,'WebForm4.aspx?HelpTextId={0}','{1}');", 5, "ToolTip"))  
        End If 
     
      End Sub 

    ToolTip page:
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server">  
      <title>Tool tip</title> 
    </head> 
    <body topmargin=0 leftmargin=0 onload="SizeToFit()">  
        <form id="form1" runat="server">  
        <script> 
      function SizeToFit()  
        {  
          window.setTimeout(  
          function()  
            {  
              var oWnd = GetRadWindow();  
              oWnd.SetWidth(document.body.scrollWidth + 4);  
              oWnd.SetHeight(document.body.scrollHeight + 70);  
            }, 400);  
        }  
             
      function GetRadWindow()  
        {  
          var oWindow = null;  
          if (window.radWindow) oWindow = window.radWindow;  
          else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
          return oWindow;  
        }   
        </script> 
          
        <table width="300px" height="400px">  
          <tr> 
            <td valign=middle align=center>  
              <asp:Label runat="server" ID="ArgumentsLabel"></asp:Label> 
            </td> 
          </tr> 
        </table> 
     
      </form> 
    </body> 
    </html> 

    Code behind of tooltip page:
      Private Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
     
        If Not Page.IsPostBack Then 
     
          Dim oArgs As String = "" 
     
          For Each key As String In Request.QueryString.Keys  
            oArgs += key + " = " + Request(key) + "<br>" 
          Next 
     
          ArgumentsLabel.Text = oArgs  
     
        End If 
     
      End Sub 

  • Posted on Apr 17, 2007 (permalink)

    Hello Morten!

    This method works, but it doesn't work efficiently for some reason? I have this issue, when I click on the control I recieve this message:

    Stop running this script?

    A script on this page is causing Internet Explorer to run slowly. If it continues to run, your conputer may become unresponsive.

    It is a pop-up dialog box that IE creates. The page just churns and churns trying to open, but it takes about a mintue, then if I click yes to stop the script it displays the content.

    What am I doing wrong?

  • DocTalkDave avatar

    Posted on Jun 25, 2008 (permalink)

    I am getting the same error

    Stop running this script?

    A script on this page is causing Internet Explorer to run slowly. If it continues to run, your conputer may become unresponsive.


    Where you ever able to resolve the issue?

    Thanks,
    Dave

  • Posted on Jun 26, 2008 (permalink)

    Yes, I was able set the javascript function to accept parameter value. Please let me know if you would like to see a sample from one of the pages I use it on.

  • Phillip avatar

    Posted on Jun 11, 2009 (permalink)

    Hi Bicini,

    I have the same problem with radwindow position with radgrid.
    Can you send me some hint s for this issue.

    Thanks.

  • Posted on Jun 12, 2009 (permalink)

    function OpenPositionedWindow(oButton, url, windowName)  
        {  
            var oWnd = window.radopen(url,windowName);   
            var oPos = GetTopLeftPosition(oButton);   
            oWnd.MoveTo(oPos.x, oPos.y + 20); //oPos.x + parseInt(oButton.clientWidth) -> will move the window to the right end of the button  
        } 



    <href="#" onclick="OpenPositionedWindow(this,'RecipFormHelp.aspx?19','RecipHelpWindow'); return false;"><img border="0" src="/Recips/images/question_mark.gif" alt="question_mark.gif" title="Help" /></a

    Above is my anchor link which calls the javascript function and passes the params.

    The calling page then requests the query value as so:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
            If Not Page.IsPostBack Then  
                For Each key As String In Request.QueryString.Keys  
                    oArgs = Request(key)  
                Next  
            End If  
        End Sub 

    Hope it makes sense, but in actuality, it is an easier method than the previously posted solutions, so once you grab the query string key value, then you can do your logic.

  • Phillip avatar

    Posted on Jun 24, 2009 (permalink)

    Thanks Bicini.
    I could make it work. Your code is so helpful.
    Thanks again for your quick reply.

    Phillip.

  • Nahid avatar

    Posted on Oct 26, 2010 (permalink)

    Hello,
    In C#, It show the error : "Request is a property but used like a method." How can I solved it? 

    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack) {
            foreach (string key in Request.QueryString.Keys) {
                oArgs = Request(key); // Error is here
            }
        }
    }

    Thanks
    Nahid

  • Posted on Jun 19, 2011 (permalink)

    just change the vb code:
    oArgs = Request(key);

    to the c#:
    oArgs = Request[key];

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Radwindow Position