WindowStartupLocation

11 posts, 0 answers
  1. david
    david avatar
    25 posts
    Member since:
    Oct 2008

    Posted 13 Mar 2009 Link to this post

    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
  2. Jonathan Miller
    Jonathan Miller avatar
    57 posts
    Member since:
    Jun 2008

    Posted 13 Mar 2009 Link to this post

    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");

     

     

     

     

  3. DevCraft banner
  4. Kevin
    Kevin avatar
    31 posts
    Member since:
    Jan 2009

    Posted 13 Mar 2009 Link to this post

    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.
  5. David Tosi
    David Tosi avatar
    3 posts
    Member since:
    Nov 2005

    Posted 13 Mar 2009 Link to this post

    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
  6. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 15 Mar 2009 Link to this post

    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.
  7. Theron Kousek
    Theron Kousek avatar
    12 posts
    Member since:
    Mar 2009

    Posted 17 Mar 2009 Link to this post

    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;

      }

    }

     


     

  8. Theron Kousek
    Theron Kousek avatar
    12 posts
    Member since:
    Mar 2009

    Posted 24 Mar 2009 Link to this post

    Hello

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

    thanks!
  9. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 25 Mar 2009 Link to this post

    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.
  10. Vic
    Vic avatar
    40 posts
    Member since:
    Mar 2009

    Posted 24 Jun 2009 Link to this post

    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
  11. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 26 Jun 2009 Link to this post

    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.
  12. Vic
    Vic avatar
    40 posts
    Member since:
    Mar 2009

    Posted 26 Jun 2009 Link to this post

    Thanks for the reply Boyan, I guess it's a timeframe we all have to work with :)

    -Vic
Back to Top
DevCraft banner