This is a migrated thread and some comments may be shown as answers.

Resize RadWindow After AjaxRequest

2 Answers 84 Views
Window
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 09 Feb 2012, 07:58 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 10 Feb 2012, 10:50 AM
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 >>
0
Daniel
Top achievements
Rank 1
answered on 10 Feb 2012, 05:33 PM
Thank you so much! It works!
Tags
Window
Asked by
Daniel
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or