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

Custom EditorTool

1 Answer 88 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 05 Jul 2009, 07:51 AM
I am trying to add a new editorTool  to a n instance of the rad editor. When I run the project with the below code, the editor displays without any tools except the one i have added manualy. When i remove the below and re-run the project all the tools are available.

EditorToolGroup main = new EditorToolGroup();
RadEditor1.Tools.Add(main);

EditorTool insertContentLink = new EditorTool();
insertContentLink.Name = "InsertContentLink";
insertContentLink.Text = "Insert Content Link";
insertContentLink.ShortCut = "CTRL+B";
main.Tools.Add(insertContentLink);

I have based my code on the demo here http://demos.telerik.com/aspnet-ajax/editor/examples/customtools/defaultcs.aspx

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 07 Jul 2009, 02:35 PM
Hi Andrew,

You should also execute the EnsureToolsFileLoaded() method before adding the custom tool, e.g

        RadEditor1.EnsureToolsFileLoaded();

        EditorToolGroup main = new EditorToolGroup();
        RadEditor1.Tools.Add(main);

        EditorTool insertContentLink = new EditorTool();
        insertContentLink.Name = "InsertContentLink";
        insertContentLink.Text = "Insert Content Link";
        insertContentLink.ShortCut = "CTRL+B";
        main.Tools.Add(insertContentLink);

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Andrew
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or