How to stop DocumentWindows being dragged outside of their radDock?

5 posts, 1 answers
  1. Chris
    Chris avatar
    5 posts
    Member since:
    Mar 2015

    Posted 09 Aug 2019 Link to this post

    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

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4001 posts

    Posted 09 Aug 2019 Link to this post

    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.
  3. Chris
    Chris avatar
    5 posts
    Member since:
    Mar 2015

    Posted 09 Aug 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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

  4. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4001 posts

    Posted 12 Aug 2019 Link to this post

    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.
  5. Chris
    Chris avatar
    5 posts
    Member since:
    Mar 2015

    Posted 12 Aug 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dress

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

    Regards

    Chris

     

Back to Top