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

RadWindow Cascading

2 Answers 119 Views
Window
This is a migrated thread and some comments may be shown as answers.
Naseem
Top achievements
Rank 1
Naseem asked on 17 Mar 2011, 05:08 AM
Hi,

I'd like to define multiple RadWindow in cascading order (attached file).

I have read the link bellow
http://www.telerik.com/help/silverlight/radwindow-features-positioning.html

Also I have read the code for RadWindow/Ordering  (which was in demo/Window/Ordering)
private void window_Opened(object sender, RoutedEventArgs e)
        {
            window.Opened -= window_Opened;
            int offsetLeft = 500;
            int offsetTop = 200;
            foreach (ExampleWindow w in windows)
            {
                w.Left = offsetLeft;
                w.Top = offsetTop;
                w.Show();
                offsetLeft += 20;
                offsetTop += 20;
            }
        }

but still I'm not sure how I can implement cacading functionality. Since in the sample the specific left and top has been set , whereas I'm looking for a solution that the first window open in the center and the next windows opens with left+=20 and Top+=20

I'd be thankful you guide me what is the best solution for that

Thank you,

2 Answers, 1 is accepted

Sort by
0
Naseem
Top achievements
Rank 1
answered on 17 Mar 2011, 05:39 AM
Hi again,

I have realized how I can achive cascading functionality . I needed to use

CategoryInfoPage.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterOwner;

 

And also

 

void CategoryInfoPage_Opened(object sender, RoutedEventArgs e)
       {
           IList<Telerik.Windows.Controls.RadWindow> lst = Telerik.Windows.Controls.RadWindowManager.Current.GetWindows();
           CategoryInfoPage.Opened -= CategoryInfoPage_Opened;
           int offsetLeft = 500;
           int offsetTop = 200;
           foreach (CategoryInfoPage w in lst)
           {
               w.Left = offsetLeft;
               w.Top = offsetTop;
               w.Show();
               offsetLeft += 20;
               offsetTop += 20;
           }
       }

It's working fine now with cascading . However as I said earlier I'm looking for a solution not to specify the offset left and top , as I'd like to show it in the center of screen.
I'm looking for either of the bellow solutions:
1. Show the first window in the center and the rest of windows displaying cascading way based on the first window top and left
2. Find the center of screen position and set top and left with that

Thank you for your help,
0
Naseem
Top achievements
Rank 1
answered on 17 Mar 2011, 05:52 AM
Here is the final solution I have found:
void CategoryInfoPage_Opened(object sender, RoutedEventArgs e)
        {
            IList<Telerik.Windows.Controls.RadWindow> lst = Telerik.Windows.Controls.RadWindowManager.Current.GetWindows();
  
            CategoryInfoPage.Opened -= CategoryInfoPage_Opened;
            double offsetLeft = ((System.Collections.ObjectModel.ReadOnlyCollection<Telerik.Windows.Controls.RadWindow>)(lst))[0].Left; 
            double offsetTop = ((System.Collections.ObjectModel.ReadOnlyCollection<Telerik.Windows.Controls.RadWindow>)(lst))[0].Top;
  
            foreach (CategoryInfoPage w in lst)
            {
                w.Left = offsetLeft;
                w.Top = offsetTop;
                w.Show();
                offsetLeft += 20;
                offsetTop += 20;
            }
  
        }

 

 

 

It gave me the left and top of first window,

 

 

 

Tags
Window
Asked by
Naseem
Top achievements
Rank 1
Answers by
Naseem
Top achievements
Rank 1
Share this question
or