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

ContentAreaMode = "Div" ignores EditorCSSFile

1 Answer 90 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Brian Stone
Top achievements
Rank 1
Brian Stone asked on 29 Sep 2010, 06:22 PM
We have the RadEditor currently using ContentAreaMode= iFrame and when the control is rendered it extends the bottom of the control beyond the Design/HTML buttons (shown in iframe.png).

I changed the ContentAreaMode to Div and that problem is resolved (shown in div.png) but now the control seems to ignore the EditorCssFile we load.

You can see that the font size has changed in the div.png file.

The .css file is not doing anything very special, I've pasted a sample below.  I can set the font-size, font-family, etc. on the control but that will break our model and I don't see any reason why using Div would cause the font-family and font-size to stop working.

The .css file is loaded with this line of code where "radEditorCSS" is the specific .css file:
radNotes.CssFiles.Add(new EditorCssFile("~/Styles/" + radEditorCSS));


p  
{  
    margin: 0px;  
}  
 
P  
{  
    margin: 0px;  
}  
 
body
{
    font-family: Courier New !important;
    font-size: 10pt !important;
}

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 30 Sep 2010, 10:57 AM
Hi Brian,

I already answered your support ticket on the subject. For convenience I will paste my answer here as well.

When RadEditor's property ContentAreaMode is set to Div the CssFiles are not applied to the editor because its content area is an editable <div> and not an <iframe> with a separate document. If you want to customize the content area appearance of the RadEditor in Div mode you need to register the CSS selectors manually on the page with the appropriate cascading.

Please note that setting global selectors to the page will affect the whole page appearance not only the RadEditor. That is why the CssFile collection is not registered by RadEditor when ContentAreaMode is set to Div.


For your concenience I have attached a sample page demonstrating how to decorate the content area.


All the best,
Dobromir
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
Tags
Editor
Asked by
Brian Stone
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or