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

Adding a new Tool Group removes existing groups

2 Answers 80 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 09 Jan 2012, 12:33 PM
Hi there,

I am trying to add a new group of commands to the default RadEditor via the following code (taken from demos):

EditorToolGroup etg = new EditorToolGroup();
rdHTMLEditor.Tools.Add(etg);
EditorTool addLoginLink = new EditorTool();
addLoginLink.Name = "AddLoginLink";
addLoginLink.Text = "Add Login Link";
etg.Tools.Add(addLoginLink);


By doing this, I lose ALL other commands / buttons from the RadEditor, which is not desirable - am I misinterpreting the method .Add() ? I would have thought it would have appended...

If I have to alter the XML to add my commands to, where can I get an up-to-date version of the XML that forms the default RadEditor? Are the files at http://www.telerik.com/support/kb/aspnet-ajax/editor/default-toolsfile-xml-file.aspx still valid?

Update: the files at the link above are not valid, as they are missing some commands (Format code block, etc.)

Thank you,

Mike Kingscott

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 09 Jan 2012, 04:20 PM
Hello,

You should make sure that the tools file is loaded by firing RadEditor1.EnsureToolsFileLoaded(); before the addition of the custom button:

RadEditor1.EnsureToolsFileLoaded();
EditorToolGroup etg = new EditorToolGroup();
rdHTMLEditor.Tools.Add(etg);
EditorTool addLoginLink = new EditorTool();
addLoginLink.Name = "AddLoginLink";
addLoginLink.Text = "Add Login Link";
etg.Tools.Add(addLoginLink);



Greetings,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Mike
Top achievements
Rank 1
answered on 09 Jan 2012, 04:52 PM
Garrrr, Steve be thankin' ya, cap'n! 

(I shouldn't have watched Dodgeball last night).
Tags
Editor
Asked by
Mike
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Mike
Top achievements
Rank 1
Share this question
or