This is a migrated thread and some comments may be shown as answers.
Printing RadWindow opened as a Modal window, is not using the print.css and is printing the parent page in Background
1 Answer 31 Views
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 10 Feb 2012, 07:12 PM

We are opening a pop-up window from the parent window with the following code. The child window which we are opening does not have any Telerik controls and it’s an external link. The window opens fine, without any issues.

In the new opened child page there is a Query which gets executed when the print button is clicked. When this Jquery is called it opens a print dialog box as expected, but when the window is printed, it’s not taking the print.css and also its printing the parent page.

 

 

.cs code
txtDDDD.NavigateUrl = "javascript:top.openMaximizePopup(‘URL’)

 

JavaScript Code in the parent page
function
openMaximizePopup(url)

{

var oWnd = top.radopen(url, "modalPopup");

      oWnd.SetSize(widthValue - 260, heightValue - 150);

      oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Maximize);

      oWnd.set_modal(true);

      if (title != "") oWnd.set_title(title);

      oWnd.Center();

}

 

Javascript in Child Page

 <script language = "javascript" type="text/javascript">

        $(document).ready(function () {

            $("input[id$= ImageButtonPrint]").click(function() 

            {

                   window.print();

            });

        });

 

 

Any help on this is appreciated.

1 Answer, 1 is accepted

Sort by
0
rdmptn
Top achievements
Rank 1
answered on 14 Feb 2012, 12:05 PM

Hi Joe,

Are you sure this button is inside the RadWindow you wish to print? It seems like your context (i.e. the window object) is not the window object of the RadWindow's iframe.

You can also take a look at this KB article or somewhere in the net (like here) on printing, as this is very browser dependent and no two browsers do this the same way. I have also never seen a browser print with all correct CSS, you can try this in a simple page (or in an iframe, doesn't matter), you will see.

Asked by
Joe
Top achievements
Rank 1
Answers by
rdmptn
Top achievements
Rank 1
Share this question
or