This project is read-only.

Treeview drag drop issue

May 11, 2009 at 6:13 PM

I'm testing a WPF treeview, my application works fine. White however?

What seems to be happening is when you do a 

Mouse.Instance.DragAndDrop(A, B);

A gets dragged to the x coordinate of B, but may never actually get dragged over B. 

For example a tree that looks like


The  drop operation takes place to the right of B (it seems white assumes B goes the entire width of the window, finds the midpoint and drops at that midpoint). If one were to change the name of B to BBBBBBBBBBBBBBBBBBBB it could work, (depending on the size of the parent window).

Rect rect = b.Bounds; // b.Bounds is returning bad information, in WPF the visual is not this wide
Assert.AreEqual(((rect1.Right - rect1.Left)/2) + rect1.Left, Mouse.Instance.Location.X, .6);

Also, the drag operation does not complete, the cursor justs sits there until I move the mouse. It seems it takes this action before the DragAndDrop method returns.

Searching the forum, yeilds other postings with similar issues, but no information.

What is the proper way to use White in this scenario?


May 18, 2009 at 10:25 PM



Could some one show me example code of a functioning drag and drop operation in WPF?

I'm doing 

where a and b exist, and it does not work, What more can I do?

May 25, 2009 at 7:59 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
May 25, 2009 at 8:02 AM

I have created an issue for first post which is about providing flexibility in terms of where to drop, instead of only at the center.

Regarding you other problem:

This seems to be an issue which is faced by a lot of people. Although at the same time white has tests which works. So it would be useful if you are someone else can provide me an example, with code where this same behavior can be seen.

Dec 8, 2009 at 12:41 AM

This work item has been marked as resolved. How do we specify the location of the drag and drop? thanks.