This is a migrated thread and some comments may be shown as answers.
How to reference to EditorCssFile
2 Answers 18 Views
This is a migrated thread and some comments may be shown as answers.
d-cpt
Top achievements
Rank 1
d-cpt asked on 11 Nov 2013, 05:53 PM

Hi,

I have a RadEditor that is created at runtime. Its forecolor and background fill doesn't response.

How to get it work? Do I have to reference RadEditor to RadEditorContenArea.CSS?

Thanks,

D.



2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 12 Nov 2013, 10:02 AM
Hi d-cpt,

Please have a look into the code snippet to add the forecolor and background color for the dynamically created RadEditor.


C#:
protected void Page_Load(object sender, EventArgs e)
{
    RadEditor editor = new RadEditor();
    editor.ID = "RadEditor1";
    editor.OnClientLoad = "load";
    this.form1.Controls.Add(editor);
}

JavaSCript:
<script type="text/javascript">
    function load(sender, args) {
        sender.get_contentArea().style.backgroundColor = "Black";
        sender.get_contentArea().style.color = "Red";
    }
</script>

Thanks,
Shinu.
0
d-cpt
Top achievements
Rank 1
answered on 12 Nov 2013, 01:59 PM

Shinu,


Your codes work great for setting default fore color and background color.

Sorry that my question wasn't clear.

My question is how to get the font color and fill color buttons response when an user wants to highlight a text and change the color of it.



Thank you,

d-cpt



// add RadEditor

RadEditor tbComment = new RadEditor();

tbComment.ID = "tbComment" + dr["STECAT_ID"].ToString();

tbComment.CssFiles.Add("~/css/EditorContentArea.css");

//tbComment.OnClientLoad = "load"; // this call the functionload() function which is in MasterSimple.master

tbComment.Width = Unit.Percentage(95);

trcell.Controls.Add(tbComment);

trow.Cells.Add(trcell);

tableEvaluation.Rows.Add(trow);





Asked by
d-cpt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
d-cpt
Top achievements
Rank 1
Share this question
or