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

Set font family for Text

1 Answer 15 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Gaurish
Top achievements
Rank 1
Gaurish asked on 13 Nov 2008, 12:36 PM
hi

how to set   font Family:Courier New  by default. to the text from Code behind .
is there any solution

Regards


1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Nov 2008, 12:58 PM
Hi Rohan,

Here is an example how to set the default font family from the codebehind:

    protected void Page_Load(object sender, EventArgs e)
    {
         RadEditor1.OnClientLoad = "OnClientLoad";

        string js = "function OnClientLoad(editor){";
        js += "editor.get_contentArea().style.fontFamily = 'Courier New'}";
       
        ScriptManager.RegisterStartupScript(Page, this.GetType(), "SetDefaultFont", js, true);
    }

Best regards,
Rumen
the Telerik team

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