FormDecortor: Width of Textboxes in IE

8 posts, 2 answers
  1. Andreas Müller
    Andreas Müller avatar
    9 posts
    Member since:
    Nov 2008

    Posted 26 Nov 2008 Link to this post

    Hi

    I'm using the FormDecorator inside the grid.
    Everything seems to work fine, Firefox renders the boxes as it should (maximum with) but unsing Internet Explorer the width of the textboxes are dynamically adjusted to the content. This means textboxes with no content (empty form for adding a new record) are only about a few pixels in width which makes it almost impossible to use the form.

    I adjusted the width of the textboxes using:

    style="width: 100%;" 

    but that doesn't do the trick.

    Best Regards,
    Andreas
  2. Andreas Müller
    Andreas Müller avatar
    9 posts
    Member since:
    Nov 2008

    Posted 26 Nov 2008 Link to this post

    I just had a look at your examples and it seems the width can only be set in pixels but not in percentage.
    But my design uses dynamic with, so I would need a possibility to set the with of the textboxes dynamically as a percentage-value as well (textbox must be as wide as the space of the table-cell that's in).
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 26 Nov 2008 Link to this post

    Hi Andreas,

    For the time being it is not possible to use percents when setting width of decorated textboxes and textareas.
    Our only suggestion is to turn decorating of textboxes off.



    Regards,
    Tervel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Andreas Müller
    Andreas Müller avatar
    9 posts
    Member since:
    Nov 2008

    Posted 26 Nov 2008 Link to this post

    Thanks for your answer.
    How would I turn off the decoration just for the textboxes? As far as I know I'm only able to turn decoraton ON for some specific controls (all or one specific).
  6. Answer
    Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 26 Nov 2008 Link to this post

    Hi Andreas,

    Decorating textboxes is not enabled by default.
    You probably set DecoratedControls = "All" explicitly.

    To fine tune the setting you should provide a comma separated list of the elements you want separated, e.g.

    DecoratedControls = "CheckBoxes, Buttons,Scrollbars" etc.


    Greetings,
    Tervel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Richard
    Richard avatar
    21 posts
    Member since:
    Dec 2007

    Posted 26 Dec 2008 Link to this post

    Is this something which will be supported?   
    The question rather ruins the FormDecorator for my uses.

    Thank you

  8. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Dec 2008 Link to this post

    Hello Richard,

    Currently this is not possible, but once IE8 which will have some extra CSS capabilities is out, we will move in this direction as well.



    Regards,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Bruce Hochstetler
    Bruce Hochstetler avatar
    155 posts
    Member since:
    Apr 2007

    Posted 31 Mar 2009 Link to this post

    Hi All,

    What I do is capture the document width and set the various textboxes style width; that seems to do the trick.

    By default I implement the pageLoad function which is equilvalent to the server side Page_Load, but for the client. I also set the window.resize = pageLoad to capture window resizes. This works for me, but then again I only have few textboxes to change.

     

    <script type="text/javascript">

     

        window.onresize = pageLoad;

     

        function pageLoad()  {

     

            window.setTimeout(

    function()

     

            {

     

                var width;

     

     

                if (typeof (window.innerWidth) == 'number')  {

     

                    width = window.innerWidth;

                }

     

                else if (document.documentElement &&

     

                        (document.documentElement.clientWidth ||

                        document.documentElement.clientHeight))  {

                    width = document.documentElement.clientWidth;

                }

     

                else if (document.body &&

     

                        (document.body.clientWidth ||

                        document.body.clientHeight))  {

                    width = document.body.clientWidth;

                }
                // get the textbox or maybe loop through your list of textboxes and set them

     

     

                var textBox= $get("TextBox");

     

     

                if (textBox)  {
                    // the width may need to be biased

     

                    textBox.style.width = width+

    "px";

     

                }

     

            }, 100);

        }

     

    </script>

    Hope that helps,
    Bruce

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017