Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/FireMonkey/Components    [ Add a report in this area ]  
Report #:  110783   Status: Closed
TreeView dragging requires two mouse clicks to initiate
Project:  Delphi Build #:  17.0.4625.53395
Version:    17.0 Submitted By:   Mike Sutton
Report Type:  Minor failure / Design problem Date Reported:  11/24/2012 7:06:18 AM
Severity:    Commonly encountered problem Last Updated: 4/23/2013 8:01:27 AM
Platform:    All platforms Internal Tracking #:   33816
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE4
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: 10
Description
Standard behaviour (at least on Windows, I can't comment on Mac) for a drag operation is simply to click and drag.

However, on a FireMonkey TTreeView you need to firstly click to select an item, then click again to begin on the now selected item to begin the drag.

Please see [Workaround] for more information.
Steps to Reproduce:
1. Add a TTreeView.
2. Set it's AllowDrag property to True.
3. Add some items.
4. Run and begin a drag operation.
Workarounds
I have a component which fixes this and other FireMonkeyTTreeView drag/drop bugs at http://monkeystyler.com/blog/entry/fixing-drag-and-drop-in-a-firemonkey-tree-view
Attachment
DragDropTreeViewBug.zip
Comments

Steffen Friedrich at 1/3/2013 10:23:00 AM -
procedure TForm2.TreeView1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Single);
  Var W:TTreeViewItem;
begin
W:=TreeView1.ItemByPoint(X,Y);
if Assigned(W) And (TreeView1.Selected <> W)
  then begin
        TreeView1.Selected:=W;  // Dragmodus geht los...
       end;
end;

Server Response from: ETNACODE01