﻿# XTF2\_DRAGDROP2

This flag enables drag/drop operations between different XTREE controls. To enable, set the flag in the source tree, and specify the advanced _coldef_ option, DragDropExit=###, in the destination tree. ### is the negative exitcode to be generated when an item (or items) from the source tree is/are dropped on to the destination tree. For example, DragDropExit=150 will generate exitcode -150.

**Comments**

•	This form of drag/drop (inter-tree) does not require any special mapping of the _answer_ array (as is required with the intra-tree drag/drop activated by XTF\_DRAGDROP).

•	Both forms of drag/drop are essentially independent (you can have either one or both).

•	No distinction is made regarding the exact position of the drop within the target control. The only information returned to the application will be the selection information for the source tree, and the DragDropExit exitcode from the target tree.

•	It is left to the application to complete the operation signified by the drag/drop action. Typically this would involve copying the selected items from the source tree to they destination tree, and perhaps removing them from the source tree.

The sample program [XTRA4.BP in EXLIB:\[908,21\]](https://bitbucket.org/microsabio/exlib/src/master/908021/xtra4.bp) has been completely rewritten to demonstrate a simple shopping cart application using this capability.

**See Also**

•	[XTF\_DRAGDROP](xtf_dragdrop2.md) to drag and drop within a single tree, for item re-ordering..

•	[XTF2\_FILEDROP](xtf2_filedrop.md) for dragging a file from an Explorer or Windows Shell dialog and dropping it on an XTREE control.

**History**

2011 January, A-Shell 5.1.1203:  Added to A-Shell