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

Context Menu

3 Answers 77 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sébastien
Top achievements
Rank 1
Sébastien asked on 02 Jul 2010, 07:31 PM
Here I am with another question : How to disable the bulit-in context menu? I have this in my toolsfile.xml :

<contextMenus> 
    <contextMenu forElement="IMG" enabled ="false"
    </contextMenu> 
    <contextMenu forElement="TABLE"
      <tool Name="ToggleTableBorder" /> 
      <tool Name="SetTableProperties" /> 
      <tool Name="DeleteTable" /> 
    </contextMenu> 
    <contextMenu forElement="TD"
      <tool Name="InsertRowAbove" /> 
      <tool Name="InsertRowBelow" /> 
      <tool Name="DeleteRow" /> 
      <tool Name="InsertColumnLeft" /> 
      <tool Name="InsertColumnRight" /> 
      <tool Name="MergeColumns" /> 
      <tool Name="MergeRows" /> 
      <tool Name="SplitCell" /> 
      <tool Name="DeleteCell" /> 
      <tool Name="SetCellProperties" /> 
    </contextMenu> 
    <contextMenu forElement="A" enabled="false"
    </contextMenu> 
    <contextMenu forElement="BODY"
      <tool Name="Cut" /> 
      <tool Name="Copy" /> 
      <tool Name="PasteFromWord" /> 
    </contextMenu> 
  </contextMenus> 

Depending on where I click I still have the old one with all the paste option.

3 Answers, 1 is accepted

Sort by
0
Sébastien
Top achievements
Rank 1
answered on 02 Jul 2010, 07:41 PM
Found how to resolve my problem, just need to add the context menu for element "P" and it seems to work :
<contextMenu forElement="BODY"
      <tool Name="Cut" /> 
      <tool Name="Copy" /> 
      <tool Name="PasteFromWord" /> 
    </contextMenu> 
    <contextMenu forElement="P"
      <tool Name="Cut" /> 
      <tool Name="Copy" /> 
      <tool Name="PasteFromWord" /> 
    </contextMenu> 

0
Sébastien
Top achievements
Rank 1
answered on 22 Jul 2010, 06:52 PM
It seems that when I'm using an external toolFile with some context menu in it, there is still some default menu for the tags that I didn't specified. I don't want my users to have access to options like "Paste to html". Can someone tell me all the menu that I must override to be sure the default one never appear.

Thanks
0
Accepted
Dobromir
Telerik team
answered on 27 Jul 2010, 12:45 PM
Hi S├ębastien,

By default, RadEditor loads context menus for element "*" which applies to all HTML elements that do not have a context menu set explicitly .

You can disable this context menu using the following approaches:
  • Using toolsfile
    <contextMenu forElement="*" enabled="false"></contextMenu>
  • From code-behind:
    RadEditor1.EnsureToolsFileLoaded();
    RadEditor1.ContextMenus.FindByTagName("*").Enabled = false;
  • Using Inline declaration
    <telerik:RadEditor id="RadEditor1" runat="server" ToolsFile="ToolsFile.xml">
        <ContextMenus>
            <telerik:EditorContextMenu TagName="*" Enabled="false"></telerik:EditorContextMenu>
        </ContextMenus>
        .....

I hope this helps.

Regards,
Dobromir
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
Tags
Editor
Asked by
Sébastien
Top achievements
Rank 1
Answers by
Sébastien
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or