Hi,
I have a problem with adding a toolbar in code in combination with the LoadToolsFile method of the RadEditor. When I use only one of them everything works fine. But when I use them both I only see the toolbar added from code. It doesn't change when I call the SetToolbar method after the creation of the dynamic toolbar.
I have the following code:
SetToolbar();
//add a new Toolbar dynamically
EditorToolGroup dynamicToolbar = new EditorToolGroup();
radTextEditor.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(
"Project Name", "{Project.Name}");
ddn.Items.Add(
"Person Firstname", "{Person.FirstName}");
ddn.Items.Add(
"Person Zipcode", "{Person.ZipCode}");
//Add tool to toolbar
dynamicToolbar.Tools.Add(ddn);
The method SetToolbar does the following:
private
void SetToolbar()
{
DAData dab = new DAData(ConfigurationManager.ConnectionStrings["configuration"].ConnectionString);
dab.CommandName =
"usp_RadEditorTools_Load";
dab.AddSqlParameter(
"projectId", long.Parse(ConfigurationManager.AppSettings["CNGRSProject"]));
dab.AddSqlParameter(
"resourceId", this.ResourceId);
string ret = (string)dab.GetReturnValue();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(ret);
radTextEditor.LoadToolsFile(xmlDoc);
radTextEditor.EnsureToolsFileLoaded();
}
I guess I'm forgetting something... but I just cannot see what that is.
Can anybody help me on this one?
Bye,
Aldert