How to trap mouse click on RadWindow border ?

2 posts, 0 answers
  1. Vasssek
    Vasssek avatar
    190 posts
    Member since:
    Aug 2010

    Posted 24 May 2012 Link to this post


    I have one issue which is related to displaying pdf report in aspx page. In our company we couldn't use Adobe PDF Reader, that's why we can't use standard telerik ReportViewer. Instead of this I have to embed pdf object into aspx page and then from server side inject into this object generated report.

    <object><embed width="100%" type="application/pdf" id="pdfObject" runat="Server"></embed></object>

    My issue appears, when user clicks on border of opened radwindow. After that, radwindow is reopen second time and generated report is regenerated , too. Strange thing is, that this issue appears only on PC with Windows7 OS and IE 8 browser. On Win XP with IE8 or Windows 7 with IE 9 this issue didn't appear. 

    So I need to prevent reopening radwindow by cancelling mouse click on border on radwindow. Please could somebody point me, how can I trap mouse event when user clicks on radwindow border ?

    Here is my page code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Report_skladove_polozky_z_objednavky.aspx.cs"
        Inherits="_Default" Async="false" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register Assembly="Telerik.ReportViewer.WebForms" Namespace="Telerik.ReportViewer.WebForms"
        TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
    <head id="Head1" runat="server">
        <%--<link href="~/Scripts/CSS/EditFormStyles.css" rel="stylesheet" type="text/css" />--%>
        <title>Tlačová zostava</title>
        <style type="text/css">       
                font-family: Arial, Helvetica;
                font-size: 14px;
            #AllPanel a
                color: black;
                text-decoration: none;
        <script language="JavaScript" 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 content_onkeydown(e) {      
                //alert("clicked in content page content");
                try {
                    if (!e) e = window.event;
                    if (e.keyCode == 27) {
                       var oWindow = GetRadWindow();  //Obtaining a reference to the current window 
                catch (err) { }       
            function FocusOnRadWindow() {
            function secondFn() {
                window.setTimeout(function () {
                    var senderElementStyle = GetRadWindow().get_popupElement().style;
                    //alert(senderElementStyle.width + "   " + senderElementStyle.height);
                    document.getElementById("pdfObject").style.height = parseInt(senderElementStyle.height) - 63 + "px";              
                }, 0)
                window.setTimeout(function () {               
                }, 1000)
            document.onkeydown = content_onkeydown;
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager2" runat="server">
        <telerik:RadSkinManager ID="RadSkinManager2" runat="server" ShowChooser="false" Skin="Hay">
       <object><embed width="100%" type="application/pdf" id="pdfObject" runat="Server"></embed></object>

    Thank you for your ideas.

    Best regards

  2. Vasssek
    Vasssek avatar
    190 posts
    Member since:
    Aug 2010

    Posted 25 May 2012 Link to this post


    I've solved described issue by myself. Thanks to this link: I found the solution.

    I just replaced line:
    <object><embed width="100%" type="application/pdf" id="pdfObject" runat="Server"></embed></object>
    <iframe style="width:100%; height:760px;" frameborder="0" id="pdfObject" runat="Server"></iframe>

    Now pdf report shows properly...

Back to Top