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

[Solved] Toolbar off, and default font

4 Answers 142 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Erling Ervik
Top achievements
Rank 1
Erling Ervik asked on 09 Mar 2010, 11:16 AM
Hi.

I have just started to use telerik:RadEditor, and I have a few problems.

1) How do I get rid of the toolbar? I have two radeditor on the same page. One of them is for reading text entred on an other page, and the other is for editing text on this page. I don't want any toolbar on the editor that is only for reading text, but I want toobar on the editor that is for editing text on the page.

2) How do I get the editor to start with a predefined font and fontsize. I have a small BasicTool.xml file like this:

ToolsFile="~/BasicTools.xml"

 

 

When used I can select from different fonts.
But I would like to set a Font (Verdana) as standard and size 13px as standard size. How do I do that?

 

 

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Mar 2010, 01:38 PM
Hello Erling,

1. You can hide the toolbar from client code. Try the following code in OnClientLoad method to hide the toolbar.
javascript:
    function OnClientLoad(editor, args) { 
        editor.get_toolContainer().style.display = "none"// Hide ToolBar  
    } 

2. And for setting the font size/font family, attach the OnClientLoad method and try the following code.
javascript:
    function OnClientLoad(editor, args) { 
        var style = editor.get_contentArea().style; 
        style.fontFamily = 'Verdana'
        style.fontSize = 13 + 'px'
    } 

Hope this helps,
Princy.
0
Erling Ervik
Top achievements
Rank 1
answered on 09 Mar 2010, 03:13 PM
Thanks.
Sorry, but I'm new to client programming.

I pasted your code between two scriptblock tags in the head of  my masterpage:
 
<script type="text/javascript" language ="javascript" > 
    // your code here  
</script> 

(Just pasting them in, did not work.)
I see that the function take some parameters, ID of the editor perhaps? But how do I call them? Should that be from client code?
I'm not familare with how to call client code.

So what do I have to do to get the code to work?

 

 

 

 

 

 

0
Rumen
Telerik team
answered on 10 Mar 2010, 02:59 PM
Hi Erling,

Please, see the following help article which provides guidance how to attach the OnClientLoad event of RadEditor: http://www.telerik.com/help/aspnet-ajax/editor_onclientload.html

The following help article is helpful too: http://www.telerik.com/help/aspnet-ajax/settingeditorbackgroundandcolor.html


Regards,
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
Erling Ervik
Top achievements
Rank 1
answered on 11 Mar 2010, 03:11 PM
Thanks. This problem is now solved. (I will make a new tread for my next problem) ;-)
Tags
Editor
Asked by
Erling Ervik
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Erling Ervik
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or