how to set listbox width and height with script

3 posts, 1 answers
  1. lin
    lin avatar
    10 posts
    Member since:
    Jun 2009

    Posted 04 Dec 2009 Link to this post

    Because width with '%' is not support on ie6, so I want to set width of listbox on client, but It seem to listbox has no method to set width.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Dec 2009 Link to this post

    Hello Lin,

    I tried following code in order to set the height and width from client side. Give a try with this.

    javascript:
     
    <script type="text/javascript"
        function setWidthHeight() { 
            var listBox = $find("RadListBox1"); 
            listBox.get_element().style.width = "400px"
            listBox.get_element().style.height = "400px"
            listBox._groupElement.style.width = "400px"
            listBox._groupElement.style.height = "400px"
        } 
    </script> 

    Thanks,
    Princy.
  3. lin
    lin avatar
    10 posts
    Member since:
    Jun 2009

    Posted 04 Dec 2009 Link to this post

    It work, thank you
Back to Top