Hi,
When adding a new tool to the toolbar from the codebehind, the Tools collection is reset and only the new tool is displayed.
If you want to remain the default tools, you should execute the
EnsureToolsFileLoaded() editor's method, e.g.
protected
void
Page_Load(Object sender, EventArgs args)
{
RadEditor1.EnsureToolsFileLoaded();
//add a new Toolbar dynamically
EditorToolGroup dynamicToolbar =
new
EditorToolGroup();
RadEditor1.Tools.Add(dynamicToolbar);
//add a custom dropdown and set its items and dimension attributes
EditorDropDown ddn =
new
EditorDropDown(
"DynamicDropdown"
);
ddn.Text =
"Dynamic dropdown"
;
//Set the popup width and height
ddn.Attributes[
"width"
] =
"110px"
;
ddn.Attributes[
"popupwidth"
] =
"240px"
;
ddn.Attributes[
"popupheight"
] =
"100px"
;
//Add items
ddn.Items.Add(
"Daily signature"
,
"TTYL,<br/>Tom"
);
ddn.Items.Add(
"Informal Signature"
,
"Greetings,<br/>Tom"
);
ddn.Items.Add(
"Official Signature"
,
"Yours truly,<br/>Tom Jones"
);
//Add tool to toolbar
dynamicToolbar.Tools.Add(ddn);
}
Kind regards,
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.