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

adding cstom dropdown to editor toolbar

2 Answers 82 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sarah
Top achievements
Rank 1
Sarah asked on 08 May 2011, 02:42 PM
I want to add a dropdown for tokens to a radeditor.  However, when I do this

<telerik:RadEditor runat="server" ID="BodyEditor" >
                    <Tools>
                        <telerik:EditorToolGroup>
                             <telerik:EditorDropDown Name="Tokens" Text="Tokens">
                             </telerik:EditorDropDown>
                        </telerik:EditorToolGroup>
                    </Tools>
                    <Content>
                    </Content>
                </telerik:RadEditor>

the formatting toolbar and others no longer appears.  I only want to add my custom dropdown, not replace the default toolbar.

2 Answers, 1 is accepted

Sort by
0
Sarah
Top achievements
Rank 1
answered on 10 May 2011, 04:20 AM
anyone who could help?
0
Rumen
Telerik team
answered on 10 May 2011, 08:31 AM
Hello Sarah,

When you set the tools collection the editor's toolbar is reset and you should manually declare all tools that you want to appear on the toolbar.

If you do not like this behavior, you can

1) add programmatically the custom dropdown via the codebehind, e.g.

BodyEditor.EnsureToolsFileLoaded(); //execute this method to load the default tools set
//add a new Toolbar dynamically   
EditorToolGroup dynamicToolbar = new EditorToolGroup();
BodyEditor.Tools.Add(dynamicToolbar);
 
//add a custom dropdown and set its items and dimension attributes   
EditorDropDown ddn = new EditorDropDown("Tokens");
ddn.Text = "Tokens";
 
//Add items   
ddn.Items.Add("Tokens", "Tokens");
ddn.Items.Add("Tokens", "Tokens");
ddn.Items.Add("Tokens", "Tokens");
 
//Add tool to toolbar   
dynamicToolbar.Tools.Add(ddn);

or via the toolsfile.xml file:

<tool name="Tokens" type="dropdown">
    <item  name="Tokens"  value="Tokens"  />
    <item  name="Tokens"  value="Tokens"  />
    <item  name="Tokens"  value="Tokens"  />
</tool>

You can download the default toolsfile.xml file from the following KB article: Default ToolsFile.xml file of RadEditor for ASP.NET AJAX and add the above dropdown declaration to one of the tools tags.

All the best,
Rumen
the Telerik team

Browse the vast support resources we have to jump start 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
Sarah
Top achievements
Rank 1
Answers by
Sarah
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or