This is a migrated thread and some comments may be shown as answers.
FormDecortor: Width of Textboxes in IE
7 Answers 102 Views
This is a migrated thread and some comments may be shown as answers.
Andreas Müller
Top achievements
Rank 1
Andreas Müller asked on 26 Nov 2008, 01:26 PM
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

7 Answers, 1 is accepted

Sort by
0
Andreas Müller
Top achievements
Rank 1
answered on 26 Nov 2008, 01:40 PM
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).
0
Accepted
Tervel
Telerik team
answered on 26 Nov 2008, 03:27 PM
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.
0
Andreas Müller
Top achievements
Rank 1
answered on 26 Nov 2008, 03:32 PM
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).
0
Accepted
Tervel
Telerik team
answered on 26 Nov 2008, 04:28 PM
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.
0
Richard
Top achievements
Rank 2
answered on 26 Dec 2008, 06:02 PM
Is this something which will be supported?   
The question rather ruins the FormDecorator for my uses.

Thank you

0
Georgi Tunev
Telerik team
answered on 29 Dec 2008, 02:35 PM
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.
0
Bruce Hochstetler
Top achievements
Rank 2
answered on 31 Mar 2009, 05:03 PM
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

 

Asked by
Andreas Müller
Top achievements
Rank 1
Answers by
Andreas Müller
Top achievements
Rank 1
Tervel
Telerik team
Richard
Top achievements
Rank 2
Georgi Tunev
Telerik team
Bruce Hochstetler
Top achievements
Rank 2
Share this question
or