Width Dependent On Buttons?

Last post 07-01-2004, 11:54 AM by jeff330ci. 3 replies.
Sort Posts: Previous Next
  •  06-30-2004, 2:05 PM 1134

    Width Dependent On Buttons?

    I am needing to programmatically set the width of the entire Editor control as it appears on my aspx pages. When I set [Editor1.Width = someIntValueLessThan100], the width of *only the text area* of the control will be reduced, while the entire control remains at its design-time width. In playing with it, I have adjusted the number of buttons by setting AutoConfigure="Minimal" or AutoConfigure="Simple", and have discovered that the width of the entire control (not just the text area) seems to be dependent on the number of buttons in the toolbar area - without regard for the current value of the width property.

     
    My question: How can I programmatically set the width of the entire editor control (buttons and all) and not just the editable text area?
     
    Thanks.
  •  06-30-2004, 2:41 PM 1136 in reply to 1134

    Re: Width Dependent On Buttons?

     jeff330ci,

     
    If you need to set the editor with less than 100,  you need to turn off the botttom bar by setting  ShowBottomBar="false".
     
    Please try the following example:
     

    <CE:Editor id="Editor1" 

       
    Template="bold"

        Width="80"

        ShowBottomBar="false"

        runat="server" >

     

    </CE:Editor>

     
    Hope it helps

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-30-2004, 4:26 PM 1139 in reply to 1136

    Re: Width Dependent On Buttons?

    Thank you Adam,
     
    Can you please verify my tentative conclusion: "Explicitly setting a custom button template (such as Template="bold") allows the Width property to affect the size of the entire control (and not just the text editing area)."
     
    Your example works. However in my testing I found that the Width property value will effect the entire control regardless of the value of ShowBottomBar. What I found regarding ShowBottomBar is that setting it to false only serves to allow the Width to be reduced below the amount of space taken up by the content of the bottom bar.
     
    An apparently important difference between your sample and my implementation is that you specify Template= while I specified AutoConfigure=. I modified your sample by removing Template="bold" and instead set AutoConfigure=[to anything other than "Default" or "Minimal"]. I found that the Width property will only affect the text editing area - while the width of the entire control is larger - enough to accommodate all the buttons appearing in their respective rows. When AutoConfigure="Default", then the Width will affect the entire control - and the buttons will get broken up into additional "rows of buttons" as needed in order to shrink the entire width.
     
    So, what I need to know is if I can count on the Width being adjusted for the entire control whenever I set a custom button template. In other words - is it true for me to think that using one of the pre-defined button templates (per AutoConfigure=) other than "Default" is what causes the issue as originally described?
     
    Thanks!
     
  •  07-01-2004, 11:54 AM 1141 in reply to 1139

    Re: Width Dependent On Buttons?

    I figured it out... in case anyone reading this thread is interested in the result:
     
    I found that (1) setting the button template explicitly {and not using AutoConfigure} and (2) including G_Start and G_End in the template string to indicate logical groupings of buttons will create button groups that will "wrap" when necessary {after the G_End of a button group} to shrink the Width of the entire control. When the control's Width is enough to accommodate all buttons, then no wrapping occurs.
     
    An example of such a template:
     

    string strTemp = @"Cut,Copy,Paste,PasteText,Separator,Bold,Italic,Underline,G_Start,FontColor,HighLight,Hr,Separator, Emotion, InsertTable,G_End, ImageGalleryByBrowsing,Link,Unlink,RemoveFormat";

    Editor1.Width = System.Web.UI.WebControls.Unit.Pixel(350);

    Editor1.Template = strTemp; //button template

     

    -Jeff

View as RSS news feed in XML