Resize RadWindow After AjaxRequest

3 posts, 1 answers
  1. Daniel
    Daniel avatar
    8 posts
    Member since:
    Jun 2009

    Posted 09 Feb 2012 Link to this post

    I've been searching and experimenting for a long time but cannot figure this one out. I have a modal RadWindow popup on my page. I have a javascript function to set the size of the window that I call in the onload event of the body of my popup (<body onload="ResizeRadWindow();"). That works great.

    I also have a RadComboBox on the page and a Label below that combo. These controls are both included in a RadAjaxManager such that when the SelectedIndexChanged event of the combo fires it will update the text within the label below it. Sometimes the text in this label will be long and shift the rest of the controls on the popup page down and cause the popup to display scrollbars. This is my problem. I already have this wonderful ResizeRadWindow javascript function that I would love to call AFTER the controls on the popup page have shifted down but I cannot figure out how to do it at the right time.

    I have tried using a Literal control on the page and setting the text of that control to "ResizeRadWindow();" within the SelectedIndexChanged event of the combo (where I set the text of the label) but the size of the page hasn't changed at that point yet so nothing appears to happen.

    Any suggestions would be great!

    Thanks,
    Dan
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    4529 posts

    Posted 10 Feb 2012 Link to this post

    Hello Dan,

    Try calling the function from the server by using the Sys.Application.Load event. You may also need to add a small timeout, even 0ms could suffice, to allow the browser time to recalculate the dimensions after the response is received.


    All the best,
    Marin
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Daniel
    Daniel avatar
    8 posts
    Member since:
    Jun 2009

    Posted 10 Feb 2012 Link to this post

    Thank you so much! It works!
Back to Top