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

How to stop DocumentWindows being dragged outside of their radDock?

4 Answers 240 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 09 Aug 2019, 12:10 PM

Hi

I am creating a number of DocumentWindows inside a radDock container. I want to be able to drag them around the radDock, but do not want them to be dragged outside of the radDock. Is there a way to do this?

Regards

Chris

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Aug 2019, 12:47 PM
Hello, Chris, 

The AllowedDockState property of the window gives you the ability to determine the available dock states. Thus, you can disable the floating state of a ToolWindow by using the code snippet below:

this.toolWindow1.AllowedDockState = ~AllowedDockState.Floating;

Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/dock/object-model/alloweddockstates 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chris
Top achievements
Rank 1
answered on 09 Aug 2019, 01:25 PM

Hi Dress

Thanks for your prompt reply.

I still want to be able to drag the documentWindow around inside the radDock and dock it to one of the sides, of the container. If I remove floating I cannot do this.

 

What I want to stop is the documentWindow moving outside of the radDock. See the attached picture. Diary is docked, but Call Notes is now outside of the radDock. Is still want to doc Call Notes next to (or above or below) Diary, but not get it go outside of the window.

 

Regards

Chris

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 Aug 2019, 12:51 PM
Hello, Chris,     

Indeed, if you eliminate the floating state, you won't be able to drag the window outside the RadDock. This requires changing the default DragDropMode of RadDock to Preview. Please refer to the attached gif file. Thus, when the AllowedDockState excludes Floating you will be still allowed to drag the window but it won't be allowed to remain as floating window:

this.radDock1.DragDropMode = DragDropMode.Preview;
this.toolWindow1.AllowedDockState = ~AllowedDockState.Floating;

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chris
Top achievements
Rank 1
answered on 12 Aug 2019, 04:06 PM

Hi Dress

Thanks for that, it was exactly what I was after.

Regards

Chris

 

Tags
Dock
Asked by
Chris
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Chris
Top achievements
Rank 1
Share this question
or