How to reference to EditorCssFile

3 posts, 0 answers
  1. d-cpt
    d-cpt avatar
    59 posts
    Member since:
    Mar 2008

    Posted 11 Nov 2013 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Nov 2013 Link to this post

    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.
  3. d-cpt
    d-cpt avatar
    59 posts
    Member since:
    Mar 2008

    Posted 12 Nov 2013 Link to this post

    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);





Back to Top