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

Adding custom dropdown in code clears default toolset

2 Answers 76 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Cesar
Top achievements
Rank 1
Cesar asked on 16 Jul 2008, 10:21 AM
Hiya,

I am trying to add a custom dropdown in codebehind, similar to that in this article,

http://www.telerik.com/support/kb/article/b454K-kdc-b454T-btc-b454c-btc.aspx

but what I would like to do is retain the current (default) tools.  When I add a custom dropdown, as in the article above, all the tools disappear except for the newly added tool.

I am not using a <tools> declaration in the aspx file.  Nor am I using RadEditor1.Tools.Clear(),  so I don't know what I could be doing wrong.

I am just simply doing
   RadEditor1.Tools.Add(myNewGroup)
which I thought would add the toolgroup to the existing tools.

This "clearing" even seems to be the case in the example, according to the screenshot for the AJAX editor, but I note the example uses a <tools> section in the aspx.

Oddly enough however, the screenshot for the classic editor seems to insert the tool, rather than replace the entire toolset, which is what I would like.

I'm sure I must be missing something simple somewhere...

Any help would be appreciated.

C

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 Jul 2008, 03:03 PM
Hi Cesar,

Please, set the EnsureToolsFileLoaded() method and test again:

        RadEditor1.EnsureToolsFileLoaded();
        EditorToolGroup myNewGroup = new EditorToolGroup();
        RadEditor1.Tools.Add(myNewGroup);

        EditorTool bold = new EditorTool();
        bold.Name = "Bold";
        bold.ShortCut = "CTRL+B";
        myNewGroup.Tools.Add(bold);

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Cesar
Top achievements
Rank 1
answered on 17 Jul 2008, 06:15 PM
Rumen,

Thank you so much.  I know it had to be something simple, and I guess I didn't see that method...

Thanks again, that worked perfectly.

Cesar
Tags
Editor
Asked by
Cesar
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Cesar
Top achievements
Rank 1
Share this question
or