RAD Window Position

10 posts, 0 answers
  1. Nikhil
    Nikhil avatar
    23 posts
    Member since:
    May 2009

    Posted 27 Aug 2009 Link to this post

    i have two RadWindows on the screen ,One window POP UP a new page when user hit a button ,,,Second is Alert window for any message.

    Right now both the window ,,,by default appear on the top of the Left hand corner..

    I wan to display them in the center of the screen . i.e. on what ever resolution user is viewing it should come in the center.

    So if i Hard code position using MArgin or any other commond ...it look in the center for 14 inch Monitor but appear on some other position on 17 inch and 20 inch monitor,,,basically it's not come in the center...


    It's very annoying for user as they are used to get messages only in the center of screen ,.,,

    How can i achived this using Telerik RADWindow and RAD Alerts

    Experts please help

    With thanks and regards
    Nikhil Jain


  2. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 28 Aug 2009 Link to this post

    Hello Nikhil,

    You should set the WindowStartupLocation to CenterScreen. This will position the window in the center of the screen in any resolution. The Alert window should appear in the center of the screen automatically, would you tell us more about the scenario in which you open the control so that it doesn't appear in the center of the screen?

    Thank you for contacting us and we look forward to receiving your answer.

    Kind regards,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Raj A R
    Raj A R avatar
    31 posts
    Member since:
    Oct 2009

    Posted 26 Oct 2009 Link to this post

    Hello Hristo,

    I have one radwindow with a Radgrid inside it, I'm populating the grid in dataservice complete event, so when the popup is opened  window is centralized (which is centralized using win.WindowStartupLocation = WindowStartupLocation.CenterScreen this code while initializing the window).

    ie before populating the radgrid the window is centralized.

    But one my collection is loaded and the radgrid is loaded this window is expanding towards the right.
    How can i make that centralized? 
    is there any property like window.Center()  which is available in the ASP.net window?
    or is there any way to refresh the window so that it will automatically centralized?

    -Raj
  5. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 29 Oct 2009 Link to this post

    Hello Raj A R,

    Unfortunately, we do not have Center method that will force RadWindow to rearrange its position. However, you can easily calculate the center location of the screen and subtract the width and the height of the window to get the proper center location. For example, if your application is already loaded and your RadWindow is arranged, as in your case, you can use this code snippet:

    Size appSize = Application.Current.RootVisual.RenderSize;
    window.Left = Math.Round((appSize.Width / 2) - (window.ActualHeight / 2), 0);
    window.Top = Math.Round((appSize.Height / 2) - (window.ActualHeight / 2), 0);
    window.ShowDialog();

    Note that the ActualHeight and ActualWidth are only valid if the control is already shown and thus arranged. The rounding is required in order to make sure your window will appear on exact pixels, and thus won't look blurred.

    If you have any other questions, feel free to contact us as soon as possible.

    Regards,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Raj A R
    Raj A R avatar
    31 posts
    Member since:
    Oct 2009

    Posted 29 Oct 2009 Link to this post

    thanks Hristo Borisov..  
  7. Mario
    Mario avatar
    75 posts
    Member since:
    Jun 2009

    Posted 14 Feb 2010 Link to this post

    hi,

    i want the radwindow at radopen() to show itself at center position. is that possible?

    cheers uspec.
  8. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 15 Feb 2010 Link to this post

    Hello Mario,

     What you need to do to achieve this is to set the WindowStartupLocation property of the RadWindow control.

    Best wishes,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  9. Phillip Garrett
    Phillip Garrett avatar
    25 posts
    Member since:
    Apr 2010

    Posted 29 Apr 2010 Link to this post

    window.Left = Math.Round((appSize.Width / 2) - (window.ActualHeight / 2), 0);

    should be:

    window.Left = Math.Round((appSize.Width / 2) - (window.ActualWidth / 2), 0);

    Note window.ActualWidth - otherwse you will get some odd results!
  10. Mario
    Mario avatar
    75 posts
    Member since:
    Jun 2009

    Posted 29 Apr 2010 Link to this post

    Hi,

    i tried to set that property "WindowStartupLocation", but theres no such property in the RadWindowManager neither is it in the RadWindow available.

    Where or how can i set this property?
    And why isnt this property set to center at default? ^^

    - Mario
  11. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 29 Apr 2010 Link to this post

    Hello Mario,

     The value of this property is not set to Center by default, because we decided to use the default one from the WPF Window which is absolute. The property WindowStartupLocation is a property of the RadWindow class.

    Greetings,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
DevCraft banner