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

preview mode css

2 Answers 113 Views
Editor
This is a migrated thread and some comments may be shown as answers.
tasos
Top achievements
Rank 1
tasos asked on 28 Jun 2010, 04:07 PM
Hello.I have used ContentAreaCssFile but i see that it's not applied in the preview area.
Any ideas?

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 01 Jul 2010, 08:39 AM
Hi Tasos,

The observed behavior is by design. You can achieve your scenario using one of these ways:
1) Set CssFiles property or
2) Enable the contentArea.css link in Preview mode:

<telerik:RadEditor ID="RadEditor1" ContentAreaCssFile="ContentArea.css" OnClientModeChange="OnClientModeChange" runat="server">
</telerik:RadEditor>
<script type="text/javascript">   
function OnClientModeChange(editor)   
{   
   var mode = editor.get_mode();   
   var doc = editor.get_document();                        
   var head = doc.getElementsByTagName("HEAD")[0];   
   var link;   
        
   switch (mode)   
   {   
      case 1:    
        break;   
      case 2:   
          break;   
      case 4: //enable the contentarea.css file in Preview mode
      setTimeout(function()
      {
        var link = head.getElementsByTagName("link")[0];
        link.disabled = false;
      }, 100);
        break;   
  }   
}   
</script>

This solution is based on this article: http://www.telerik.com/support/kb/aspnet-ajax/editor/applying-external-stylesheet-to-the-content-of-radeditor-in-preview-mode.aspx

Greetings,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
tasos
Top achievements
Rank 1
answered on 01 Jul 2010, 09:26 AM
Thank you!
Tags
Editor
Asked by
tasos
Top achievements
Rank 1
Answers by
Rumen
Telerik team
tasos
Top achievements
Rank 1
Share this question
or