Version

Configuring Drag and Drop (xamDataTree)

The xamDataTree™ control supports drag and drop functionality, which is based on the Infragistics Drag and Drop framework. For more information see the Infragistics Drag and Drop Framework topics. You can enable this functionality on xamDataTree, by setting the xamDataTree control’s IsDraggable and IsDropTarget properties. You can also set these properties on a particular node layout.

The following code demonstrates how to enable drag and drop.

In XAML:

<ig:XamDataTree x:Name="MyTree" IsDraggable="True" IsDropTarget="True">
    <!-- TODO: Add xamDataTree nodes -->
</ig:XamDataTree>

In Visual Basic:

MyTree.IsDraggable = True
MyTree.IsDropTarget = True

In C#:

MyTree.IsDraggable = true;
MyTree.IsDropTarget = true;

Setting the IsDraggable property means that nodes can be dragged from the tree/node layout and setting the IsDropTarget property means that nodes can be dropped onto this tree/node layout

When your end user drags a node within the tree, that node is added to the items source for the level your end user is dropping it.

For example, if your tree consists of two parent nodes, which both have children, then you can move the children nodes from one parent node to the children of the other parent node.

You cannot drag a parent to be a child of itself.

You cannot drop a node of Type A into a collection of Type B.

Events

There are four event associated with xamDataTree as described in the following list. These events allow you to perform some custom logic during the drag and drop lifecycle.

Note
Note:

The NodeDraggingStart event is cancellable.

Related Topics