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

Can a floating pane NOT always be TopMost with regard to the main window?

7 Answers 134 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 07 Nov 2011, 12:12 PM
See subject line.

I want to tear off a pane to be floating and then ble able that the main window (the starting window that is hosting the RadDocking Control) can be in front of the pane (toolwindow) that is now floating. Is this possible?

I've seen that you can override the default implementation of IGeneratedItemsFactory which is consulted when the toolwindow is created. Would that help me?

Regards,
Frank

7 Answers, 1 is accepted

Sort by
1
Miroslav Nedyalkov
Telerik team
answered on 09 Nov 2011, 09:36 AM
Hi Frank,

What you need to do is to inherit from the ToolWindow class and override the GetWindowOwner virtual method and return null instead of what the base method returns. You can use use the GeneratedItemsFactory then to return instance of your custom ToolWindow. Please refer to the attached project.

Kind regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Frank
Top achievements
Rank 1
answered on 09 Nov 2011, 03:00 PM
Hi Miroslav,
thanks a lot for your help. That goes in the right direction. Setting the toolwindow owner to null removes the modality.

However, there is a catch. When I start dragging the tool window it disappears behind the main window. If I minimize the main window, then the tool window remains visible but is strangely aware of the old window state: The dock symbols appear in mid-air and I can dock into the minimized window. :) This I could probably sell as feature, but the disappearing behind the main window is not very nice.

I know it probably gets into funny terrain now, but if you have any idea what could change the behaviour (Z-Index?), please let me know.

Regards
Frank
0
Miroslav Nedyalkov
Telerik team
answered on 10 Nov 2011, 12:04 PM
Hi Frank,

As this functionality is not built-in the Docking control it is not fully supported and some issues (like the ones you are experiencing) might occur. We will target the problem with the ZIndex in future, but I cannot give you concrete time frame for this. I cannot give you a work-around for the problem as well.

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mart71
Top achievements
Rank 1
answered on 24 Mar 2015, 06:33 PM
We are using the Telerik 2014.2.729.40 version and the behaviour described in the previous posts (Nov 2011) are still there. Any developments for this issue ?

Thanks
0
Nasko
Telerik team
answered on 25 Mar 2015, 02:59 PM
Hi Martin,

We completely understand your concerns. However, with the current implementation of RadDocking when a Pane becomes floating (turns into ToolWindow) it is always on top of the MainWindow - this is how the control is expected to work. The only approach that we could suggest you in order to achieve a similar to the desired behavior of the ToolWindows is the one proposed by Miroslav.

Hopes this helps.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Davide
Top achievements
Rank 1
answered on 12 May 2016, 09:58 AM

Hi ... 

the issue I'm seeing with Miroslav implementation is that when I try to drag a floating window back into the main window the floating window goes behind. Is there a solution to this issue?

 

Thx in advance

1
Mart71
Top achievements
Rank 1
answered on 12 May 2016, 11:12 AM

Hi Davide,

The solution provided by Telerik to make the floating tab not "always on-top", is to set the owner of the WindowHost to null. But this solution has a major drawback: While draging the floating tab back in the main window, it disappears behind the main window.

My solution consist to set the window TopMost on DragStart and set it back to non-TopMost on DragEnd. Just add the following methods in CustomToolWindow class (see the project provided by Telerik on 09 Nov 2011 above in this thread : Docking_ToolWindows_NotChildWindows.zip)  :

      protected override void OnDragStart(System.Windows.Point globalMousePosition, bool isResize)
         {
         base.OnDragStart(globalMousePosition, isResize);
         var windowHost = Window.GetWindow(this);
         if (windowHost != null)
            {
            windowHost.Topmost = true;
            }
         }

      protected override void OnDragEnd(Point globalMousePosition, bool isCancel, bool isResize)
         {
         base.OnDragEnd(globalMousePosition, isCancel, isResize);
         var windowHost = Window.GetWindow(this);
         if (windowHost != null)
            {
            windowHost.Topmost = false;
            }
         }

 

Martin

Tags
Docking
Asked by
Frank
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Frank
Top achievements
Rank 1
Mart71
Top achievements
Rank 1
Nasko
Telerik team
Davide
Top achievements
Rank 1
Share this question
or