I'm trying to load a RadEditor at runtime from a custom control, i managed to get the RadEditor to render but the Editor does not seem to render correctly. Please see attached.
I can't seem to upload images but take a look at http://www.carlfretwell.co.uk/Images/Editor.JPG to see what I mean.
Carl
[DefaultProperty("Text")] |
[ToolboxData("<{0}:Content runat=server></{0}:Content>")] |
public class Content : WebControl |
{ |
RadEditor contentEditor; |
public Content() |
{ |
} |
/// <summary> |
/// Load the UserControl |
/// </summary> |
protected override void CreateChildControls() |
{ |
base.CreateChildControls(); |
contentEditor = new RadEditor(); |
contentEditor.ToolsFile = "App_Data/Editor.xml"; |
contentEditor.ID = "radEditor"; |
contentEditor.Skin = "Black"; |
contentEditor.Content = TemplateHelper.PageContent; |
this.Controls.Add(contentEditor); |
} |
/// <summary> |
/// Render this Web Part to the output parameter specified. |
/// </summary> |
/// <param name="output"> The HTML writer to write out to </param> |
protected override void Render(HtmlTextWriter output) |
{ |
EnsureChildControls(); |
if (contentEditor != null) |
{ |
contentEditor.RenderControl(output); |
} |
} |
} |
I can't seem to upload images but take a look at http://www.carlfretwell.co.uk/Images/Editor.JPG to see what I mean.
Carl