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

Applying external stylesheet to the content of RadEditor in HTML mode

1 Answer 86 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rajesh Venkataraman
Top achievements
Rank 1
Rajesh Venkataraman asked on 11 Aug 2008, 04:53 AM
Hi,

I was looking at (ID#943) to applying external stylesheet to the content of RadEditor in Preview mode.  However, i need to change the background color in HTML mode.  How do i do this.  Following the same approach does not work for the HTML mode.

Thanks,
Raj

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 11 Aug 2008, 07:32 AM
Hi Rajesh,

You can use the following code to get a reference to the content area in Html mode of RadEditor:

<script type="text/javascript">
function OnClientLoad(editor, args)
{
    editor.add_modeChange(function(sender, args)
    {     
       var mode = sender.get_mode();                   
       if (mode == 2)
       { 
           var htmlArea = editor.get_textArea();
           htmlArea.style.backgroundColor = "red";
       }
    });
}
</script>
<telerik:radeditor runat="server" ID="RadEditor1" OnClientLoad="OnClientLoad">
    <ImageManager ViewPaths="~/Images" UploadPaths="~/Images" />
</telerik:radeditor>


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Rajesh Venkataraman
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or