Resize Editor

Apr 9, 2008 at 9:55 AM
hi i have added Rich text editor.and i need to resize whole Editor(make small).how can i do that ??

tnx
chaminda
Apr 9, 2008 at 6:50 PM
If you look in the Rte.cs file you will see code which defines the Textarea of the Rich Text Editor:
if (IsSet("Theme") && String.Compare(this.Theme, "Classic") == 0)
iFrame.Style.Add(HtmlTextWriterStyle.Width, "723px");
else
iFrame.Style.Add(HtmlTextWriterStyle.Width, "740px");

iFrame.Style.Add(HtmlTextWriterStyle.Height, "500px");
iFrame.Attributes.Add("frameborder", "0");

and also,

writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "723px");

It has been a while since I modified this but I believe you can change these settings in coordination with setting the Height & Width attributes in the actual tag. If you want to change the width of the Rich Text Editor, you will have to modify the Buttons and toolbar in the editor accordingly.
Apr 16, 2008 at 7:14 PM
Making a change to the height or width property of the control has no effect on the size.
Apr 16, 2008 at 8:31 PM
The Height and Width properties will not effect the size alone. The source code needs to be modified as well, see above. You could also modify the source code to set all height settings based on the Height and Width properties.
Aug 15, 2008 at 4:08 AM
Is there any update coming out soon to fix this so that the size is determined by the property or does someone have some code to fix this....
    
Developer
Aug 15, 2008 at 11:31 AM
This should have been fixed with Change Set 11713. The release is out of date so try downloading and building the latest source. Let us know if that fixes your problem or not.
Aug 15, 2008 at 10:23 PM
I have downloaded this and built it. Yes it does fix the resizing for atleast the Blue theme but the Classic theme it still is showing the object being larger then the area.
Is there any help on fixing this because that is the theme that blends oh so well with my site already.    
Developer
Aug 18, 2008 at 12:29 PM
I'm not having the same problem with the Classic theme. Could you maybe post some minimal code that reproduces the issue? Then I'll take a look at why it's happening. Thanks!
Dec 16, 2008 at 7:53 PM
Hello!

First of all, congratulations for the projet, it's amazing. About the resize, I solved the problem commenting the following code on the class RTE.cs:

                //EnsureChildControls(); // DEV NOTE: I think this call is requiring me to set Height and Width before Theme. Does it need to be here?

It's inside the theme property, and it didn't changed the values because it sets the height and widht value before:
---------------------------




public string Theme
        {
            get
            {
                //EnsureChildControls(); // DEV NOTE: I think this call is requiring me to set Height and Width before Theme. Does it need to be here?
                String s = (String)ViewState["Theme"];
                return ((s == null) ? String.Empty : s);
            }

            set
            {
                //EnsureChildControls(); // DEV NOTE: I think this call is requiring me to set Height and Width before Theme. Does it need to be here?
                ViewState["Theme"] = value;
            }
        }
--------------------------

Now using something like that will work:

<cc1:RichTextEditor ID="Rte1" Theme="Blue" Height="150" Width="250"  runat="server" /> 


Best Regards,
Leandro Pilan





Aug 19, 2011 at 11:24 AM

Where can you find the Rte.cs file?