How to disable docking but use pin/unpin feature?

1 Answer 240 Views
Dock
Ram
Top achievements
Rank 1
Ram asked on 19 Aug 2021, 07:02 AM
I have a Telerik.WinControls.UI.Docking.ToolWindow added to RadDock. I want to use the pin/unpin feature and not the docking feature. I want to disable the contextmenu and not allow user to move around the ToolWindow as well. How do I acheive it?

1 Answer, 1 is accepted

Sort by
1
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 19 Aug 2021, 08:15 AM

Hi, Ram,

AllowedDockState property gives you the ability to determine the available dock states per ToolWindow. There are several options for this property that can be combined by bitwise operations. More information you can find here: https://docs.telerik.com/devtools/winforms/controls/dock/object-model/alloweddockstates 

In order to use the autohide function by clicking on the pin/unpin button you can use the following code snippet:

this.toolWindow1.AllowedDockState = AllowedDockState.Docked | AllowedDockState.AutoHide;

According to the context menu. RadDock uses ContextMenuService. Each context menu request is passed to the service, which on its hand creates the appropriate menu items and raises several events, which allows users to modify existing items, add their own or even cancel the request. When handling the ContextMenuDisplaying event you are able to cancel showing the context menu for the toolwindow by using e.Cancel=true. More information is available here: https://docs.telerik.com/devtools/winforms/controls/dock/architecture-and-features/using-the-contextmenuservice 

I hope this helps. If you have other questions do not hesitate to ask.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Ram
Top achievements
Rank 1
commented on 24 Aug 2021, 07:39 AM

It worked. Thanks Nadya.
Tags
Dock
Asked by
Ram
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or