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

WindowStartupLocation

10 Answers 286 Views
Window
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 13 Mar 2009, 10:46 AM
Hi,

I have installed the 2009-q1 controls for silverlight and after a few adjustments to the code
I have the following strange behaviour with my radWindow,

I have a window which is set at WindowStartupLocation.CenterParent, it works fine with the
default and vista themes, but when I use the summer theme the window is located at the top left
of the screen.

the only change in the code for this to achieve is to change of the theme name

10 Answers, 1 is accepted

Sort by
0
Jonathan Miller
Top achievements
Rank 1
answered on 13 Mar 2009, 01:03 PM
I'm having a similar issue with RadAlert.  Using default theme, from code-behind, places the radAlert in the top left corner of the screen.  Any ideas are appreciated, thanks.  Here is the simple code from code-behind.

RadWindow.Alert("test");

 

 

 

 

0
Kevin
Top achievements
Rank 1
answered on 13 Mar 2009, 08:37 PM
I am having similar problems with the new release. I have noticed the things noted above~2c but I also am having problems with CenterScreen which worked fine before. Now anything I set to CenterScreen actually shows up in the lower right hand corner. So I have a weird mix of windows opening to the top left and bottom right when I actually want them all in the center.
0
David Tosi
Top achievements
Rank 1
answered on 13 Mar 2009, 11:07 PM
I am having the same problem and it was driving me nuts! Anyways, I came up with a temporary work-around. First off, I always display a custom control inside of a dialog so you may have to modify a bit if you have code inline.

Set the WindowStartupLocation to Manual and then hook into the custom control's Loaded event and add the following code:

private void Dialog_Loaded(object sender, RoutedEventArgs e) 
{
   var window = RadWindow.GetParentRadWindow(this);
   window.Left = Application.Current.Host.Content.ActualWidth / 2 - this.ActualWidth / 2; 
   window.Top = Application.Current.Host.Content.ActualHeight / 2 - this.ActualHeight / 2; 

A real fix will be nice but this works ok for now.

-David Tosi
www.inphonite.com
0
Hristo Borisov
Telerik team
answered on 15 Mar 2009, 02:07 PM
Hello to all,

We are appologizing for the caused inconvenience, it turns out that we have introduced a bug with the latest changes in our RadWindow. Currently, you can set the ModalBackground of any dialog windows using the ModalBackground property of DialogParameters like this:

 RadWindow.Alert(new DialogParameters() { ModalBackground = new SolidColorBrush(Colors.Black) }); 

We will response with a hotfix in a couple of days, which will not require you to set any locations or brushesh. Please excuses for this bug again, and we hope that issue will not be a show stopper for you until we provide you with a hot fix.

Regards,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Theron Kousek
Top achievements
Rank 1
answered on 17 Mar 2009, 11:35 AM
I like your solution better.  The following below "almost" worked but since I did not specify a size on the window directly, the width was too "narrow".   Explicitly setting a size on the window and then using CenterParent did the trick.



RadWindow window = new RadWindow()

 

{

 

};

 

Page p = new Page();

 

window.Content = p;

window.WindowStartupLocation =

WindowStartupLocation.CenterParent;

 

window.Header =

"RadWindow";

 

window.Top = 0;

window.Left =0;

window.LeftOffset = 0;

window.TopOffset =0;

p.SizeChanged +=

new SizeChangedEventHandler(mySizeChange);

 

window.ShowDialog();
.....



 

private

 

void mySizeChange(object o, SizeChangedEventArgs e)

 

{

 

  int i = 0;

 

 

  if (e.PreviousSize == new Size(0, 0))

 

  {

 

   Page p = o as Page;

 

 

   RadWindow w = p.Parent as RadWindow;

 

   w.Height = e.NewSize.Height;

  w.Width = e.NewSize.Width;

  }

}

 


 

0
Theron Kousek
Top achievements
Rank 1
answered on 24 Mar 2009, 08:40 PM
Hello

was wondering approximately when a hotfix would be available for this?

thanks!
0
Hristo
Telerik team
answered on 25 Mar 2009, 11:22 AM
Hello Theron Kousek,

The hotfix will be publicly available with the next Service pack release.
If this is a show-stopper for you just open a support ticket and we will send you the hotfix.

Regards,
Hristo
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Vic
Top achievements
Rank 2
answered on 24 Jun 2009, 07:03 PM
Hi Hristo,

I experience issues using the modal option and defining the WindowStartupLocation:

...
<RadWindow>.WindowStartupLocation =WindowStartupLocation.CenterScreen;
<RadWindow>.ShowDialog();

The window opens to the upper left corner of theapplication each time.
 
Though using <RadWindow>.Show() works asexpected, displaying it in the center.
 
I am using version: 2009.1.526.1020
 
Any ideas?
 
Thanks,
Vic
0
Boyan
Telerik team
answered on 26 Jun 2009, 02:43 PM
Hello Vic,

This is a known issue. The good thing is that we have already fixed it and it will be working in the forthcoming Q2 release due in a couple of weeks.

Sorry for the caused inconvenience.

Hope that this timeframe is acceptable for you.

Regards,
Boyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Vic
Top achievements
Rank 2
answered on 26 Jun 2009, 02:48 PM
Thanks for the reply Boyan, I guess it's a timeframe we all have to work with :)

-Vic
Tags
Window
Asked by
david
Top achievements
Rank 1
Answers by
Jonathan Miller
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
David Tosi
Top achievements
Rank 1
Hristo Borisov
Telerik team
Theron Kousek
Top achievements
Rank 1
Hristo
Telerik team
Vic
Top achievements
Rank 2
Boyan
Telerik team
Share this question
or