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

Context menu does not appear in my editor

1 Answer 117 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ludovic
Top achievements
Rank 1
Ludovic asked on 26 Nov 2010, 03:52 PM
Hi

I've got some problem with context menu.

I defined my radeditor in a ContentPage.skin file like this : 

 

<rad:radeditor runat="server" SkinId="Editor"  Width="100%"  StripFormattingOptions="MSWordRemoveAll,Font,Css,Span" NewLineBr="true">
 <ImageManager ViewPaths="~/FilesDB/Emailing" UploadPaths="~/FilesDB/Emailing" DeletePaths="~/FilesDB/Emailing" EnableImageEditor="true" EnableThumbnailLinking="false" />
     <FontNames>
       <rad:EditorFont Value="Trebuchet MS" />   
   </FontNames>
          <Tools>
     <rad:EditorToolGroup Tag="MainToolbar">
         <rad:EditorTool  name="AjaxSpellCheck"/>
         <rad:EditorTool  name="FindAndReplace" shortcut="CTRL+F"/>
         <rad:EditorTool  name="Copy" shortcut="CTRL+C"/>
         <rad:EditorTool  name="Paste" shortcut="CTRL+V"/>
         <rad:EditorTool  name="PasteFromWord" />
         <rad:EditorTool  name="PasteFromWordNoFontsNoSizes" />
         <rad:EditorTool  name="PastePlainText" />
         <rad:EditorTool  name="PasteAsHtml"  />
         <rad:EditorSeparator/>
         <rad:EditorTool  name="Undo" shortcut="CTRL+Z"/>
         <rad:EditorTool  name="Redo" shortcut="CTRL+Y"/>
         <rad:EditorTool  name="ImageManager" shortcut="CTRL+G"/>
         <rad:EditorTool  name="ImageMapDialog"/>
         <rad:EditorTool  name="LinkManager" shortcut="CTRL+K"/>
         <rad:EditorTool  name="Unlink" shortcut="CTRL+SHIFT+K"/>
    </rad:EditorToolGroup>
    <rad:EditorToolGroup>
         <rad:EditorTool  name="Bold" shortcut="CTRL+B"/>
         <rad:EditorTool  name="Italic" shortcut="CTRL+I"/>
         <rad:EditorTool  name="Underline" shortcut="CTRL+U"/>
         <rad:EditorTool  name="StrikeThrough" />
          <rad:EditorSeparator/>
         <rad:EditorTool  name="JustifyLeft" />
         <rad:EditorTool  name="JustifyCenter" />
         <rad:EditorTool  name="JustifyRight" />
         <rad:EditorTool  name="JustifyFull" />
         <rad:EditorTool  name="JustifyNone" />
        <rad:EditorSeparator/>
         <rad:EditorTool  name="Indent" />
         <rad:EditorTool  name="Outdent" />
         <rad:EditorSeparator/>
         <rad:EditorTool  name="InsertOrderedList" />
         <rad:EditorTool  name="InsertUnorderedList" />
         <rad:EditorTool  name="ConvertToLower" />
         <rad:EditorTool  name="ConvertToUpper" />
         <rad:EditorSeparator/>
         <rad:EditorTool  name="InsertTable" />
         <rad:EditorTool  name="InsertSymbol" />
    </rad:EditorToolGroup>
    <rad:EditorToolGroup Tag="DropdownToolbar">
         <rad:EditorTool  name="FormatBlock"/>
         <rad:EditorTool  name="FontName"/>
         <rad:EditorTool  name="RealFontSize"/>
         <rad:EditorSeparator/>
         <rad:EditorTool  name="ForeColor"/>
         <rad:EditorTool  name="BackColor"/>
    </rad:EditorToolGroup>       
    </Tools>   
     <Modules>        
        <rad:EditorModule Name="RadEditorStatistics" Enabled="true" />
    </Modules>      
    <Languages>
        <rad:SpellCheckerLanguage Code="en-US" Title="Anglais"/>
        <rad:SpellCheckerLanguage Code="fr-FR" Title="Français"/>
    </Languages>    
     <CssFiles>
        <rad:EditorCssFile Value="~/RadEditor.css" />
    </CssFiles>
   </rad:radeditor>

If i put a radeditor with this skin in a form, the context menu doesn't appear anymore and if I add
a <contextmenu> tag 
<ContextMenus>
<telerik:EditorContextMenu Enabled="true" />
</ContextMenus>
in my skin file, the context menu appears but is always empty

If I remove the <tools> part, the context menu reappears.
I don't understand why.

Do I miss something ?

My telerik radeditor version is v4.0.30319

Thank you for your help

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 30 Nov 2010, 03:09 PM
Hi Ludovic,

This is expected behavior of RadEditor. By design, the default context menus are registered in the default RadEditor's toolsfile. When inline <tools> tag is set the default toolsfile is not loaded. When setting RadEditor's tools declarative you need to add all the items as well. To enable the default context menus need to add them manually to the skin file. The following are the default context menus:
<ContextMenus>
    <rad:EditorContextMenu TagName="*">
        <rad:EditorTool Name="Cut" />
        <rad:EditorTool Name="Copy" />
        <rad:EditorTool Name="Paste" />
        <rad:EditorTool Name="PasteFromWord" />
        <rad:EditorTool Name="PastePlainText" />
        <rad:EditorTool Name="PasteAsHtml" />
        <rad:EditorTool Name="PasteHtml" />
    </rad:EditorContextMenu>
    <rad:EditorContextMenu TagName="TABLE">
        <rad:EditorTool Name="ToggleTableBorder" />
        <rad:EditorTool Name="SetTableProperties" />
        <rad:EditorTool Name="DeleteTable" />               
    </rad:EditorContextMenu>
    <rad:EditorContextMenu TagName="TD">
        <rad:EditorTool Name="InsertRowAbove" />
        <rad:EditorTool Name="InsertRowBelow" />
        <rad:EditorTool Name="DeleteRow" />
        <rad:EditorTool Name="InsertColumnLeft" />
        <rad:EditorTool Name="InsertColumnRight" />
        <rad:EditorTool Name="DeleteColumn" />
        <rad:EditorTool Name="MergeColumns" />
        <rad:EditorTool Name="MergeRows" />
        <rad:EditorTool Name="SplitCell" />
        <rad:EditorTool Name="SplitCellHorizontal" />
        <rad:EditorTool Name="DeleteCell" />
        <rad:EditorTool Name="SetCellProperties" />
        <rad:EditorTool Name="SetTableProperties" />
    </rad:EditorContextMenu>
    <rad:EditorContextMenu TagName="IMG">
        <rad:EditorTool Name="SetImageProperties" />
        <rad:EditorTool Name="ImageMapDialog" />
    </rad:EditorContextMenu>
    <rad:EditorContextMenu TagName="A">
        <rad:EditorTool Name="SetLinkProperties" />
        <rad:EditorTool Name="Unlink" />
    </rad:EditorContextMenu>
</ContextMenus>


All the best,
Dobromir
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
Ludovic
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or