How to recenter window when content size changes?

4 posts, 0 answers
  1. Manuel Ruf
    Manuel Ruf avatar
    9 posts
    Member since:
    Apr 2010

    Posted 15 Feb 2011 Link to this post

    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.
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 16 Feb 2011 Link to this post

    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>>
  3. DevCraft banner
  4. Manuel Ruf
    Manuel Ruf avatar
    9 posts
    Member since:
    Apr 2010

    Posted 17 Feb 2011 Link to this post

    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
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 18 Feb 2011 Link to this post

    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
Back to Top