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

RAD Window Position

9 Answers 448 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nikhil
Top achievements
Rank 1
Nikhil asked on 27 Aug 2009, 06:51 PM
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


9 Answers, 1 is accepted

Sort by
0
Hristo Borisov
Telerik team
answered on 28 Aug 2009, 06:58 AM
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.
0
Raj A R
Top achievements
Rank 1
answered on 26 Oct 2009, 09:22 AM
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
0
Hristo Borisov
Telerik team
answered on 29 Oct 2009, 07:58 AM
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.
0
Raj A R
Top achievements
Rank 1
answered on 29 Oct 2009, 11:18 AM
thanks Hristo Borisov..  
0
Mario
Top achievements
Rank 2
answered on 14 Feb 2010, 02:06 PM
hi,

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

cheers uspec.
0
Miroslav Nedyalkov
Telerik team
answered on 15 Feb 2010, 12:24 PM
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.
0
Phillip Garrett
Top achievements
Rank 1
answered on 29 Apr 2010, 09:50 AM
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!
0
Mario
Top achievements
Rank 2
answered on 29 Apr 2010, 10:43 AM
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
0
Miroslav Nedyalkov
Telerik team
answered on 29 Apr 2010, 01:47 PM
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.
Tags
Window
Asked by
Nikhil
Top achievements
Rank 1
Answers by
Hristo Borisov
Telerik team
Raj A R
Top achievements
Rank 1
Mario
Top achievements
Rank 2
Miroslav Nedyalkov
Telerik team
Phillip Garrett
Top achievements
Rank 1
Share this question
or