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

Removing right-click context menu

4 Answers 112 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Debbie Roberts
Top achievements
Rank 1
Debbie Roberts asked on 09 Jul 2010, 09:42 AM
Hi Telerik,

How do I remove the right-click context menu in the RadEditor content pane? By this I mean the one that has cut/copy/paste/paste from word/paste plain text/paste as html.

Also, is it possible to remove individual items from this context menu, e.g. remove 'paste from word' but leave 'paste as plain text'?

Debbie

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 09 Jul 2010, 09:44 AM
Hi Debbie,

You can see how to predefine the context menus of RadEditor in this live demo and help articles:
Context Menus and Context Menus (help).

Kind regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Debbie Roberts
Top achievements
Rank 1
answered on 04 Aug 2010, 03:15 PM
Hi Rumen,

I'd already tried the suggestions in those articles that you have given but they do not work.

I need to remove these:

<telerik:EditorTool Name="PasteFromWord" />
<telerik:EditorTool Name="PastePlainText" />
<telerik:EditorTool Name="PasteAsHtml" />

so that they never appear in the editor at all when it is right-clicked.

This is what I have done:

<telerik:RadEditor ID="RadEditor1" 
    OnClientCommandExecuted="OnClientCommandExecuted" runat="server"
    Language="en-GB"
    ContentFilters="ConvertToXhtml,MozEmStrong">
    <telerik:ContextMenus>
        <telerik:EditorContextMenu TagName="BODY">
            <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" />
        </telerik:EditorContextMenu>
    </telerik:ContextMenus>
</telerik:RadEditor>

but when I go into the editor, and do a right-click, I still get the three special paste options.

How do I switch those three items off, so that they never appear anywhere in the editor?
0
Rumen
Telerik team
answered on 04 Aug 2010, 05:11 PM
Hi Debbie,

The following code works fine on my end:

<telerik:radeditor runat="server" id="RadEditor1" Language="en-GB" ContentFilters="ConvertToXhtml,MozEmStrong">
  <ContextMenus>
      <telerik:EditorContextMenu TagName="P">
          <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" />
      </telerik:EditorContextMenu>    
            <telerik:EditorContextMenu TagName="BODY">
          <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" />
      </telerik:EditorContextMenu
   </ContextMenus>
</telerik:radeditor>

For your convenience I have attached my project and video demonstrating my test at: http://screencast.com/t/NTRhYmZhZjk.


Sincerely yours,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Debbie Roberts
Top achievements
Rank 1
answered on 05 Aug 2010, 09:20 AM
Many thanks, Rumen. That's solved the problem.

D
Tags
Editor
Asked by
Debbie Roberts
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Debbie Roberts
Top achievements
Rank 1
Share this question
or