We have a project in production where we implemented a simple RadWindow and allow the iframe content to be printed.
This has worked fine for years, but since IE11 the print functionality has stopped working. I tried upgrading to the latest Telerik suite but it did not fix the issue.
Here is the snippet I am using to accomplish the printing which is almost a literal copy from the Telerik examples (which works in every IE prior to 11, Chrome, and Firefox for us)
<script type=
"text/javascript"
>
function
PrintIframeContent() {
var
oWindow = GetRadWindow();
var
content = oWindow.GetContentFrame().contentWindow;
var
printDocument = content.document;
if
(document.all) {
printDocument.execCommand(
"Print"
);
}
else
{
content.print();
}
}
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow) oWindow = window.radWindow;
else
if
(window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return
oWindow;
}
function
CloseWin() {
//Get the RadWindow
var
oWindow = GetRadWindow();
//Call its Close() method
oWindow.Close();
}
</script>
I can see the code is getting executed when debugging but it does not fire an actual print command in the browser (to show the print dialogue).
If I force my IE11 browser into IE10 Document Mode then everything works as expected.
For some reason the content.print() seems to do nothing now under Edge mode. Oddly enough if I use the other function from the JavaScript printDocument.execCommand("Print") then everything works fine in IE11 Edge mode.
Can someone explain what is going on here as this has been in production and working for years until this, and I had to implement this change not knowing why this is now happening.
Also a side note, I had to force my IE11 browser into IE10 Document Mode emulation on this page also to even get the RadEditor menu items to show so I could use/see the 'Format Code Block' option.
Thank you please advise