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

Disable right mouse click

4 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
JK
Top achievements
Rank 1
JK asked on 12 May 2008, 04:46 PM
Hi,

I am using Q1 reporting with ASP.  Specifically, I have created a report within a radwindow which works well, however, you can right click anywhere on the preview and it brings up the full IE quick menu.

I tried to remove this by adding the basic javascript code to disable right clicking but it worked outside of the report but not on the report itself.

Is there any way of restricting the right mouse click?

Thanks,

Jon

4 Answers, 1 is accepted

Sort by
0
Accepted
Chavdar
Telerik team
answered on 13 May 2008, 01:44 PM
Hi JK,

At this moment there is no way to disable the context menu in the report area. It renders as an iframe element and you cannot add custom javascript code to the document which is shown there. We will put down your request and will try to think of a possible solution for achieving this functionality.

Let us know if other questions/problems come to mind.

Best wishes,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
AJ
Top achievements
Rank 1
answered on 22 Mar 2012, 03:53 PM
Has there ever been any update to this? I'm finding that some people are right clicking the report and going to print and it's coming out as blank pages.
0
Accepted
Steve
Telerik team
answered on 27 Mar 2012, 04:08 PM
Hello AJ,

You can easily achieve this with the help of some javascript:

<telerik:ReportViewer ID="ReportViewer1" runat="server" />
 
  <script type="text/javascript">
      ReportViewer.prototype.OnReportLoadedOld = ReportViewer.OnReportLoaded;
      ReportViewer.prototype.OnReportLoaded = function () {
          this.OnReportLoadedOld();
 
          var reportFrame = document.getElementById(this.reportFrameID);
          var reportDocument = reportFrame.contentWindow.document;
          var body = reportDocument.getElementsByTagName("body")[0];
          body.oncontextmenu = function () { return false; };
      }
  </script>


Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
AJ
Top achievements
Rank 1
answered on 29 Mar 2012, 05:38 PM
That was easy. Thanks!!!!
Tags
General Discussions
Asked by
JK
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
AJ
Top achievements
Rank 1
Steve
Telerik team
Share this question
or