This example demonstrates how to drag-and-drop rows from the Grid Control to the Tree List control. To support drag-and-drop operations within the GridView, set the ColumnViewOptionsBehavior.EditorShowMode property to either MouseUp or Click. This prevents a cell editor from being opened on the MouseDown event, as this event is used for initialization of drag-and drop operations. To allow the Tree List to accept data dropped onto it, set its AllowDrop property to true.
The TreeList.GetDXDragEventArgsDrag method is used to convert drag event arguments to the DXDragEventArgs type. This allows you to get extended drag-and-drop parameters. The following parameters are used in this example:
- DXDragEventArgsDrag.TagetNode - the target node over which the row is dropped;
- DXDragEventArgsDrag.DragInsertPosition - specifies how a node is inserted (as a child, before or after a node, or at the end of the node collection).
The TreeList is bound to a BindingList data source. Nodes are added using the AppendNode method overload, which takes an array of column values as a parameter. The order of values in this array should match the order of the public properties in the data source.
Question Comments
Added By: JJDX at: 8/27/2015 5:07:24 AM
Hello, could you redone your example to not require VS 2015 or VS 2013 ? I think that many of us still use 2012. Thanks :)
Added By: Sasha (DevExpress Support) at: 8/28/2015 4:12:19 AMHi,
I've updated this example. Please test it and let me know if you can run it with VS 2012 now.