Set the Rad splitter height and width on window resize

7 posts, 0 answers
  1. Nataraj Vedula
    Nataraj Vedula avatar
    21 posts
    Member since:
    Aug 2008

    Posted 19 Nov 2008 Link to this post


    I wrote a small script to set the height and width of splitter on window resize. I am getting an script error saying that object doesn't support this property or method. Please help me to set the desired height and width for the splitter. Below is the script.

    <script type="text/javascript">   
        function resized()  
            var splitter = document.getElementById("ctl00_ReportContent_Splitter1").id;  

    I even tried spliiter.resize(). This also gave JS error. I referred the splitter's ClientSide API from


  2. Vyrban
    Vyrban avatar
    31 posts
    Member since:
    Nov 2008

    Posted 24 Nov 2008 Link to this post


    I think, you use the correct methods but in the wrong level of abstraction. As i see in your code:
    var splitter = document.getElementById("ctl00_ReportContent_Splitter1").id; 
    splitter is not an object, but string! So you can not expect splitter.set_height and splitter.set_width to work.

  3. Antony
    Antony avatar
    41 posts
    Member since:
    Jan 2009

    Posted 18 Mar 2009 Link to this post


    In case anybody else is viewing this thread. Nataraj would have been better off referencing the object like this

    var splitter = $find("ctl00_ReportContent_Splitter1"); 

  4. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 18 Mar 2009 Link to this post

    Hi guys,

    Actually, Antony is correct and if you have to use the control's API you should reference its client object which should be done by using the $find method. By using the getElementById or $get methods, you reference a HTML element and it does not support the API of the client object.

    I also recommend to use block brackets in order to dynamically evaluate the client ID instead of hard-coding it as shown below:

    var splitter = $find("<%=Splitter1.ClientID%>");  

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Eric
    Eric avatar
    82 posts
    Member since:
    Feb 2009

    Posted 24 Mar 2009 Link to this post

    Hi Svetlina,

    I am trying to size a splitter and your answer above should help but my splitter is in a master page and it looks like the "<%=Splitter1.ClientID%>" is not allowed in a master page.

    Is there an easy way around this?

  6. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 24 Mar 2009 Link to this post

    Hello Eric,
    You can just wrap your javascript code in a RadCodeBlock. Please refer to our online documentation for information on this control.

    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  7. Eric
    Eric avatar
    82 posts
    Member since:
    Feb 2009

    Posted 25 Mar 2009 Link to this post

Back to Top