Adding a new Tool Group removes existing groups

3 posts, 1 answers
  1. Mike
    Mike avatar
    20 posts
    Member since:
    Jan 2011

    Posted 09 Jan 2012 Link to this post

    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. Answer
    Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 09 Jan 2012 Link to this post

    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
  3. Mike
    Mike avatar
    20 posts
    Member since:
    Jan 2011

    Posted 09 Jan 2012 Link to this post

    Garrrr, Steve be thankin' ya, cap'n! 

    (I shouldn't have watched Dodgeball last night).
Back to Top