VitrtualStringTree. How to Drag'n'Drop to ROOT level?
- by Alexandr
A have a tree:
ROOT - VirtualStringTree(You don't see it, TVirtualStringTree.RootNode)
- My Root Node 1
- My Root Node 2
- - Second node 1
- - Second node 2
- - Second node 3
- My Root Node 3
I can Drag'n'Drop "My Root Node 3" to any visible node, but I can't return it to defaut position, to the root level of tree.
I try that:
//Part of code from OnDragDrop Event of VirtualStringTree
if (Sender.DropTargetNode = Sender.RootNode) then
begin
for i := 0 to high(Nodes) do
begin
LinksTree.MoveTo(Nodes[i], Sender.DropTargetNode, Attachmode, False);
end;
end;
I places mouse to nowhere, but nothing happens. In DragOver I accepted drop to root if DropTarget is VST.RootNode.
Anybody knows, how to drop node to VST.RootNode if I drag mouse to empty space of component?