radWindow Always Opens Small when Using iFrame

9 posts, 0 answers
  1. Shawn
    Shawn avatar
    83 posts
    Member since:
    Jan 2009

    Posted 20 May 2010 Link to this post

    I have a page that when the user clicks a link to a pdf file it opens in a radWindow for print or view, etc.

    The problem is that the pdf radWindow ALWAYS opens very small, as small as it can. I can resize it, but I want it to open using the dimensions I provided below.

    Here is my code:

    MainPage:
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
                <script type="text/javascript"
     
                    function ShowInvoice(file) { 
                        window.radopen("InvoiceWindow.aspx?file=" + file, "InvoiceWin"); 
                        return false; 
                    } 
     
     
                </script> 
     
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
        <Windows> 
                            <telerik:RadWindow Skin="Sunset"  ID="InvoiceWin" runat="server" Title="Monthly Invoice" Height="800" 
                            Width="850" Left="10px" ReloadOnShow="true" Modal="true"  ShowContentDuringLoad="false" Animation="None" /> 
                    </Windows> 
        </telerik:RadWindowManager> 
            </telerik:RadCodeBlock>  

    InvoiceWindow.aspx:
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Dealership Invoice Viewer</title> 
        <script type="text/javascript"
            function GetRadWindow() { 
                var oWindow = null
                if (window.radWindow) oWindow = window.radWindow; 
     
                else if (window.frameElement.radWindow) 
                    oWindow = window.frameElement.radWindow; 
     
                return oWindow; 
            } 
             
            function CloseRadWin() { 
                //get a reference to the RadWindow 
                var oWnd = GetRadWindow(); 
                //close the RadWindow 
                oWnd.close();  
            } 
         
        </script> 
    </head> 
    <body> 
        <form id="form1" runat="server"
        <iframe style="width:820px; height:680px;" id="iframe1" runat="server"></iframe><br /> 
        <href="#" onclick='return CloseRadWin();'><img src="images/close_win.gif" border="0" style="vertical-align: middle" /> Close Invoice</a> 
        </form> 
    </body> 
    </html> 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
                iframe1.Attributes("src") = Request("file"
     
        End Sub 

    Any idea why the invoice window always opens to small?

  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 25 May 2010 Link to this post

    Hi Shawn,

    I tested the following source code (based on the one you sent), and it works as expected. The RadWindow is opened with width="850px" and height="800px".
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                <script type="text/javascript">
                    function ShowInvoice(file)
                    {
                        var oWindow = radopen("InvoiceWindow.aspx?file=" + file, "InvoiceWin");
                        return false;
                    }
                </script>
            </telerik:RadCodeBlock>
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                <Windows>
                    <telerik:RadWindow Skin="Sunset" ID="InvoiceWin" runat="server" Title="Monthly Invoice"
                        Height="800" Width="850" Left="10px" ReloadOnShow="true" Modal="true" ShowContentDuringLoad="false"
                        Animation="None" />
                </Windows>
            </telerik:RadWindowManager>
            <input type="button" value="Show_Window_Via_RadOpen" onclick="ShowInvoice('started.pdf')" />
        </div>
        </form>
    </body>
    </html>

    In case that you still experience this problem, please provide a live url, where we can observe the problem.

    Regards,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mr. Rony
    Mr. Rony avatar
    3 posts
    Member since:
    Apr 2006

    Posted 08 Jul 2010 Link to this post

    Hi Shawn and Telerik

    I have the same scenario, but the problem it's another. When you click the Print Button of the PDF Reader, the Print Dialog desappear or it hide back of the RadWindows. How can to fix this behavior, for the end user it's important to  print the PDF, their dosen't understan what happen when will click the Print Button, anc click again and again.

    Please Advice me, if have solution ?


    Rony
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 13 Jul 2010 Link to this post

    Hello Rony,

    Could you please provide more details on your case? I assume that you are talking about the reader's Print dialog, but it is a desktop item and it cannot go behind RadWindow.
    It will be best to open a support ticket and to send us a small sample project where this issue could be reproduced so we could investigate further.


    Kind regards,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Tom
    Tom avatar
    17 posts
    Member since:
    Jan 2009

    Posted 27 Oct 2010 Link to this post

    I have an issue that may be related to the initial subject of this thread:

    I would like to display streamed PDF within a RadWindow, so I'm using the recommended configuration where the RadWindow contains an iframe whose source will be set to the stream.  I would like this RadWindow to be flexible and reusable from different parts of the application, so I need the iframe to automatically size to the RadWindow size.  I thought I could do this by setting the frame's width and height to 100%, but only the width seems to work: the height seems to be fixed at around 150px and does not resize with the RadWindow (but the width does).

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="PdfLoadingTempPage.aspx.vb" Inherits=".PdfLoadingTempPage" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server" >
            <iframe id="iframeToStopLoadIndication" runat="server" width="100%" height="100%" >
            </iframe>
        </form>
    </body>
    </html>

    I'm probably missing something simple... but what is it?

    Thanks,
    Tom
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Oct 2010 Link to this post

    Hi Tom,

    Add the following style in your page and your scenario should work as expected:

    <%@ Page Language="C#" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <title></title>
        <style type="text/css">
            html, body, form
            {
                padding: 0;
                margin: 0;
                height: 100%;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <iframe id="iframeToStopLoadIndication" runat="server" width="100%" height="100%">
        </iframe>
        </form>
    </body>
    </html>

    Note: make sure that you have cleared your browser's cache before checking the result as IE has the nasty habit to cache IFRAMEs' content so good that even Ctrl+F5 wouldn't work some times :)

    Sincerely yours,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Syed Nadeem
    Syed Nadeem avatar
    19 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2012 Link to this post

    Hi VanyRon,

    I have the same issue as you. Do you recollect what was the resolution?

    Thanks,
    N.
  9. Andy
    Andy avatar
    10 posts
    Member since:
    Jun 2012

    Posted 22 Dec 2015 in reply to Georgi Tunev Link to this post

    Hi,

    I have exact same problem as described by Tom & resolution by Georgi didn't solve that issue. Have attached picture, what I see in the HTML developer tool. Exactly as mentioned by Tom. cPanel height gets changed (154px). So even after having size bigger, in the outer windows the height gets reduced. The only solution to increase the height ,currently is increase he height explicitly by specific pixels. Any ideas how I can solve this issue?

     

    Thanks

     

  10. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 24 Dec 2015 Link to this post

    Hi Andy,

    The thread addresses the dimensions of RadWindow in iframe element. By examining the snapshots sent, I see RadSplitter is used. 

    As this is a different scenario, I suggest you posting a new forum post or send a support ticket with more details about the certain situation and markup examples of the configuration.  

    Regards,
    Ianko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017