However now using IE11 it prints the entire page behind the window as well.
In Firefox works fine and only prints the contents of the Radwindow.
Would appreciate and any.
Thanks
Glenn
5 Answers, 1 is accepted
Hello Glenn,
What is important is that the correct context is used when the print() command is executed. The browser detemines this and prints that page. The sample shows how to get the RadWindow iframe's object and this article expands on the matter of calling functions in the different contexts: http://www.telerik.com/help/aspnet-ajax/window-programming-calling-functions.html.
You may also find useful the examples from this KB article as well because it treats printing in more detail: http://www.telerik.com/support/kb/aspnet-ajax/window/details/printing-the-contents-of-a-radwindow. What is important is that we do not and cannot control the way the browser interprets this command and the best advice I can provide is to test out this KB too and to see how your IE behaves with a simple iframe instead of a RadWindow.
Regards,
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
if
(document.all)
{
…
//IE 6/7/8/9/10 will run this
}
else
{
…
//chrome, firefox, IE11 will run that
}
FROM: http://www.julien-manici.com/blog/important-compatibility-changes-in-IE11-on-Windows-8-1/
Seems working now on IE11 and Firefox by changing to:
function
CheckIsIE11() {
if
(Object.hasOwnProperty.call(window,
"ActiveXObject"
) && !window.ActiveXObject) {
// is IE11
alert(
"true"
);
return
true
;
}
alert(
'false'
);
return
false
;
}
function
printWin(e) {
var
oManager = GetRadWindowManager();
var
oWnd = oManager.GetWindowByName(
"RadWindowPreview"
);
var
content = oWnd.GetContentFrame().contentWindow;
var
printDocument = content.document;
if
(document.all || CheckIsIE11()) {
alert(
'ie'
);
printDocument.execCommand(
"Print"
);
}
else
{
alert(
'other'
);
content.print();
}
//Cancel event!
if
(!e) e = window.event;
return
$telerik.cancelRawEvent(e);
}
Can you see any issue using this change?
Thanks
Hello Glenn,
As long as the browser detection you have in place work for your needs, I do not see issues with the approach.
Regards,
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Thanks!
Hi Matt,
Here is the KB: http://www.telerik.com/support/kb/aspnet-ajax/window/details/adding-a-custom-button-to-radwindow-titlebar. You can use that button to call the functions that will print the needed contents: http://www.telerik.com/support/kb/aspnet-ajax/window/details/printing-the-contents-of-a-radwindow.
Regards,
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.