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

Auto size Editor

1 Answer 104 Views
Editor
This is a migrated thread and some comments may be shown as answers.
jwhitley
Top achievements
Rank 1
jwhitley asked on 23 Apr 2010, 05:27 PM
I have a number (variable) of Editors on a page which each show dynamic content in preview mode. This is so that poorly formatted HTML within that content does not have adverse affects on the rest of the page (the Editor acts as a kind of quarantine for each piece of content).

I'd like each Editor panel to be as small as possible, but autosize up to a maximum height based on the size of its content. I don't believe Editor can calculate the size needed to display certain content, but can I, client side, do something like:

1.) Iterate through each Editor
2.) Set size to a nominal small value
3.) Check if the vertical scroll bar is showing and the Editor has not already reached it's maximum height allowed
4.) If true, increase the height of the Editor by 10px and repeat step 3

Is it possible to achieve this and / or are there more elegant solutions?

Regards

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 28 Apr 2010, 09:55 AM
Hi John,

In order to achieve the required functionality you need to set the AutoResizeHeight property of RadEditor to true and set height to the minimum required value, e.g.:

<telerik:RadEditor ID="RadEditor1" runat="server" EditModes="Preview" ToolsFile="empty.xml" ToolbarMode="ShowOnFocus" AutoResizeHeight="true" Height="150px">
</telerik:RadEditor>

Please note that there is a problem with Firefox - IFRAME with height less than 150px is not rendered correctly and RadEditor's content area is an editable IFRAME.

For your convenience I have attached a sample project.

Kind regards,
Dobromir
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.
Tags
Editor
Asked by
jwhitley
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or