How to drag a dock from one RadTab to another?

2 posts, 0 answers
  1. Laurent
    Laurent avatar
    4 posts
    Member since:
    Feb 2012

    Posted 23 Feb 2012 Link to this post

    The question is in the title :)

    Just know that the RadTab are created dynamically, as well as the RadDock.
    Is there a way to drag a dock from one tab to another?

    Thanks in advance.
  2. Slav
    Slav avatar
    1351 posts

    Posted 27 Feb 2012 Link to this post

    Hi Laurent,

    You can achieve such functionality by placing a RadDockZone in every RadPageView of the RadTabStrip control. This way you will be able to move a RadDock from one page view to another. Note that the RadTabStrip should be wrapped in a RadDockLayout so that the layout of the dock controls is persisted through postback.

    As only one tab is selected at a time, you will have to switch the tabs in order to be able to drag a RadDock from one tab to another. In case you are using the default dock mode (RadDock's DockMode property is set to Default), you can just drag the RadDock outside the RadTabStrip control, change the tab manual and drag it in the new RadDockZone. If you have configured the RadDock with DockMode="Docked", changing its position will require some customization, because the tabs of RadTabStrip do not switch on mouseover out-of-the-box. To achieve the desired functionality in such a case, you can use the RadDock's OnClientDragStart client-side event in order to attach a handler for the mousemove event, which will be utilized to detect the position of the cursor while a dock controls is being dragged. When the cursor is positioned over a tab, the client-side method set_selected(true) of the RadTab object should be used to change the tab and to move the RadDock in the new RadDockZone.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top