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

Prevent RadPane Dragging Off the Screen

3 Answers 130 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Ferenc
Top achievements
Rank 1
Ferenc asked on 19 Oct 2010, 10:17 AM
Hello!

I'm using RadDocking control. Unfortunately If i drag the floating window outside the view area of the browser and drop i cannot get it back.

As i saw RadWindow control has a usefull "IsRestricted" property but there is no RadPane :(  Help me, please!

Thank You
Ferenc Kostka

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 19 Oct 2010, 11:01 AM
Hello Ferenc,

Thank you for contacting us.

We have already added this request in our Public Issue Tracking System (PITS). You can view it here. You can vote for it, track its status and see when it is going to be implemented.

Please feel free to contact us if you have any other questions.

Kind regards,
Konstantina
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
Todd
Top achievements
Rank 1
answered on 18 Nov 2010, 03:57 AM
Here's a solution to this problem that forces the Pane back into view when it's been dragged off the screen:

private ToolWindow getToolWindow(RadPane Pane)
 {
     ToolWindow toolWindow = Pane.ParentOfType<ToolWindow>();
     if (toolWindow == null)
     {
         toolWindow = (((Pane.Parent as RadPaneGroup).Parent as RadSplitContainer).Parent) as ToolWindow;
     }   
     return toolWindow;
 }
 private void radDockingMain_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
 {
     RadPane pane = e.Source as RadPane;
       
     if(pane != null && pane.IsFloating)
     {
         ToolWindow toolWindow = getToolWindow(pane);
           
         if (toolWindow != null)
         {
             toolWindow.LostMouseCapture += new System.Windows.Input.MouseEventHandler(toolWindow_LostMouseCapture);
         }
     }  
 }
 void toolWindow_LostMouseCapture(object sender, System.Windows.Input.MouseEventArgs e)
 {
     ToolWindow toolWindow = (ToolWindow)sender;
     if (toolWindow.HorizontalOffset < 0)
     {
         toolWindow.HorizontalOffset = 1;
     }
     if (toolWindow.VerticalOffset < 0)
     {
         toolWindow.VerticalOffset = 1;
     }
     if (toolWindow.HorizontalOffset > radDockingMain.ActualWidth - 100)
     {
         toolWindow.HorizontalOffset = radDockingMain.ActualWidth - 100;
     }
     if (toolWindow.VerticalOffset > radDockingMain.ActualHeight - 100)
     {
         toolWindow.VerticalOffset = radDockingMain.ActualHeight - 100;
     }
 }

Regards,
Todd
0
Konstantina
Telerik team
answered on 23 Nov 2010, 08:46 AM
Hi Todd,

We are glad that you have found a solution yourself.

I am sending you also our workaround. Please find the attached project.

If you have any other questions about our controls please feel free to contact us again.

Greetings,
Konstantina
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Docking
Asked by
Ferenc
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Todd
Top achievements
Rank 1
Share this question
or