# Drag and Drop

The **Drag and Drop** compatibilities of the **RadDocking** control allow you to re-arange the panes in a complete **WYSIWYG** manner. When the process of dragging starts, the [Compass](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/compass) menu appears to help you dock/undock your panes.

Below you can find several step-by-step tutorials for the most common operations that can be accomplished via drag and drop.

> tip Find out how to implement [conditional docking](https://www.telerik.com/products/wpf/documentation/controls/raddocking/how-to/implement-conditional-docking) using **PreviewShowCompass** event exposed by **RadDocking**.

## Docking Panes to a Container

1. Click on the pane's header and start dragging it to the container you wish to dock your pane to.

2. As soon as your mouse enters a container, the **Compass** appears right in its middle.

3. While keeping the mouse button down, position your mouse cursor over the **compass indicator** that points to the area you wish to dock your pane to. Notice how the possible Dropping Area is highlighted.

4. Drop the pane and see how it is docked in the highlighted area.

   ![Docking Panes to a Container](https://www.telerik.com/products/wpf/documentation/assets/eee02d98b3e3cf9c989f6bbdd44f1c86/raddocking_features_drag_and_drop_010.png)

As you can see you have dragged your pane over the Compass' right indicator which leads to highlighting the respective dropping area inside the underlying container.

> Note that the Compass menu always marks the possible docking positions within the container your mouse cursor is currently over.

## Docking Panes to the Root Container

1. Click on the pane's header and start dragging it.

2. The **Root Compass** appears.

3. While keeping the mouse button down, position your mouse cursor over the **root compass indicator** that points to the area you wish to dock your pane to. Notice how the possible Dropping Area is highlighted.

4. Drop the pane and see how it is docked in the highlighted area.

   ![Docking Panes to the Root Container](https://www.telerik.com/products/wpf/documentation/assets/bc7117c6dbd8f9ef197c34b698d17279/raddocking_features_drag_and_drop_020.png)

> Note that the Root Compass always marks the possible docking positions only for the root container.

## Adding Panes to Tabbed Documents

1. Click on the pane's header and start dragging it to the container you wish to dock your pane to.

2. As soon as your mouse enters a container, the **Compass** appears right in its middle.

3. While keeping the mouse button down, position your mouse cursor over the **compass' center indicator**. Notice how the whole container is highlighted as Dropping Area.

4. Drop the pane and see how it is docked as a new tab.

   ![Adding Panes to Tabbed Documents](https://www.telerik.com/products/wpf/documentation/assets/35b61319e90ff2851d0072b7518163a7/raddocking_features_drag_and_drop_030.png)

> tip To dock a pane to a [Tabbed Document](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/pane-groups), drag and drop it over the center indicator of the Compass.

> tip To create a split layout inside a single tab, use a nested [RadDocking](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/nesteddocking) with separate `RadPaneGroup` elements inside a `RadSplitContainer`. Dragging a pane to the center indicator creates a tab in the current group; it does not create a nested split layout.

## Undocking Panes

1. Click on the docked pane's header and start dragging it.

2. While keeping the mouse button down, position your mouse cursor outside any **Compass** elements.

3. Drop the pane and notice that it is undocked and placed as a separate window ([ToolWindow](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/tool-window)).

   ![Undocking Panes](https://www.telerik.com/products/wpf/documentation/assets/8b0eb6380667e7052f03058761c5f93f/raddocking_features_drag_and_drop_040.png)

> tip To undock a pane and make it floatable, just drag it out of its current place and drop it outside any compass indicator.

## Using Native ToolWindow Drag

As of **R1 2020 SP1**, the RadDocking control exposes a **UseNativeInitialToolWindowDrag** property through which you can set to **True** to use the native Windows drag operation when first undocking a pane/group. This is useful if you wish to be able to use the [Windows Snap Assist feature](https://support.microsoft.com/en-us/help/4027324/windows-10-snap-your-windows) or take into account the "Show window contents while dragging" Windows setting.

**Enable Native ToolWindow Drag**

```XAML
<telerik:RadDocking x:Name="radDocking" UseNativeInitialToolWindowDrag="True">
    
</telerik:RadDocking>
```

![Use Native ToolWindow Drag](https://www.telerik.com/products/wpf/documentation/assets/4a6a1d6b9dddf934510e986667ec017a/raddocking_features_drag_and_drop_050.png)

## Moving Panes Between RadDocking Instances

By default the panes in a `RadDocking` instance can be docked (or drag and dropped) only in the same `RadDocking` instance. To allow docking panes from one `RadDocking` instance to another, set the `DragDropGroup.Name` attached property on the `RadDocking` elements. Both instances should have the same name.

**Enable docking between separate RadDocking instances**

```XAML
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <telerik:RadDocking dock:DragDropGroup.Name="mainDragDropGroup">
        
    </telerik:RadDocking>

    <telerik:RadDocking dock:DragDropGroup.Name="mainDragDropGroup" Grid.Column="1">
        
    </telerik:RadDocking>
</Grid>
```

## See Also

* [Tool Window](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/tool-window)
* [Compass](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/compass)
* [Save/Load Layout](https://www.telerik.com/products/wpf/documentation/controls/raddocking/features/save-load-layout/overview)
