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

radWindow Always Opens Small when Using iFrame

8 Answers 226 Views
Window
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 20 May 2010, 07:29 PM
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?

8 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 25 May 2010, 01:25 PM
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.
0
Mr. Rony
Top achievements
Rank 2
answered on 08 Jul 2010, 02:49 PM
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
0
Georgi Tunev
Telerik team
answered on 13 Jul 2010, 11:08 AM
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
0
Tom
Top achievements
Rank 1
answered on 27 Oct 2010, 04:19 PM
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
0
Georgi Tunev
Telerik team
answered on 29 Oct 2010, 12:05 PM
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
0
Syed Nadeem
Top achievements
Rank 1
answered on 26 Jul 2012, 07:33 PM
Hi VanyRon,

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

Thanks,
N.
0
Andy
Top achievements
Rank 1
answered on 22 Dec 2015, 05:52 PM

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

 

0
Ianko
Telerik team
answered on 24 Dec 2015, 08:29 AM
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
Tags
Window
Asked by
Shawn
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Mr. Rony
Top achievements
Rank 2
Georgi Tunev
Telerik team
Tom
Top achievements
Rank 1
Syed Nadeem
Top achievements
Rank 1
Andy
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or