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

How to recenter window when content size changes?

3 Answers 92 Views
Window
This is a migrated thread and some comments may be shown as answers.
Manuel Ruf
Top achievements
Rank 1
Manuel Ruf asked on 15 Feb 2011, 09:22 AM
Hi,

The windows in our application are mostly fixed in width but should change the height dynamically depending on the content that is loaded.
The problem now is that if I set the window to 'CenterScreen' and the content is loaded into the window after the window has opened the window will not recenter.
Meaning that depending on the content, the bottom of the window might actually disappear 'under' the browser. Since we do not allow windows to be moved by the user, this is a problem.

Is it possible to somehow trigger a recentering of the window? Or a smart routine so I can do it myself?

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 16 Feb 2011, 11:55 AM
Hi Manuel,

You can refer to this forum post in which is explained how to center the RadWindow in the browser. You can use the same approach to position the RadWindow in your application. Also, you can try the RestrictedAreaMargin and IsRestricted properties, which will help you restrict the Window to the visible area of the browser.

Hope this information helps. Please let us know if you have further questions.

Kind regards,
Konstantina
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Manuel Ruf
Top achievements
Rank 1
answered on 17 Feb 2011, 02:48 PM
So if I understand you correctly:
1. Hook into the SizeChanged event of the RadWindow
2. When the Size changes, get size of plugin and calculate the new center position
3. Position RadWindow manually with the calculated position
0
Konstantina
Telerik team
answered on 18 Feb 2011, 01:08 PM
Hi Manuel,

Yes, you have understood correctly. This is the right way to do this.

Please let us know if you have any other questions about our controls.

Best wishes,
Konstantina
the Telerik team
Tags
Window
Asked by
Manuel Ruf
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Manuel Ruf
Top achievements
Rank 1
Share this question
or