TAdvTreeView drag and drop drawing issue

Hello,

i using the following code to perform the movement of a node.

procedure TForm1.AdvFavTreeDragDrop(Sender, Source: TObject; X, Y: Integer);
var TargetNode : TAdvTreeViewVirtualNode;
    SourceNode : TAdvTreeViewVirtualNode;
begin
  AdvFavTree.BeginUpdate;
  SourceNode := AdvFavTree.SelectedVirtualNode;
  TargetNode := AdvFavTree.XYToNode(X, Y);
  AdvFavTree.MoveNode(SourceNode.Node,TargetNode.Node, SourceNode.ParentNode )  ;
  AdvFavTree.EndUpdate;
end;

After the node has been moved, there is only a white rect at the destination position.
A manual mouse click solves the issue.
error

I have tried a .update , .refresh , .repaint command after the drop, but nothing has an effect.

Can you please send the full sample, which drag & drop interaction are you using exactly?

You need a Procedure for DragOver too. Only with both procedures assigned, the error occours.
Take a new treeview and set "Interaction.DragDropMode" to "tdmMove".

TreeTest.zip (92.0 KB)

The treeview already handles everything internally and automatically applies a move operation. If you want to manage custom drag & drop, please assign the events OnCustomDrag* or OnCustomDrop* programmatically instead of using the built in drag & drop mode. They need to be assign programmatically. (see TAdvTreeView + DragMode - #3 by Pieter_Scheldeman)

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.