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

[Solved] RadEditor height changes size switching between views

1 Answer 139 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ryan Spitler
Top achievements
Rank 1
Ryan Spitler asked on 09 Jul 2009, 08:01 PM
I am take over an exiting project and working on an issue that has arrised on one of our pages that has the RadEditor 7.2 on it. The app runs inside sharepoint, and it appears that even with the height of the editor set in the code behind, as soon as you switch to HTML view, the editor height increases, switching back to design view causes it to increase again. It just keeps getting larger for each switch. This is causing the content below the editor to "disappear" in the frameset, the scroll bars in IE don't seem to recognize the new height. Any ideas?

1 Answer, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 14 Jul 2009, 02:06 PM
Hello Ryan,

Please review the following KB article http://www.telerik.com/support/kb/aspnet-ajax/editor/editor-width-expands-when-switching-to-html-mode-and-back-to-design-mode.aspx.

In order to achieve the functionality described in it you need to add the following code in the respective ConfigFile.xml or ListConfigFile.xml (for forms such as list, wiki, blog), which are located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.x.x.x__1f131a624888eeed\RadControls\Editor folder.
<property name="OnClientModeChange">OnClientModeChange</property> 

Then define the javascript method OnClientModeChange some where on the page where the editor is loaded. I personaly add it to the master page.
function OnClientModeChange(editor, args) 
        { 

            var htmlArea = document.getElementById("RadEContentTextarea" + editor.Id); //reference to the HTML mode content area 
            htmlArea.style.width = (editor.GetWidth()-30) + "px";  
            htmlArea.style.height = (editor.GetHeight()-30) + "px";  
        } 
 

I hope this helps.


Kind regards,
Stanimir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Ryan Spitler
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Share this question
or