Posted By: WillemM | Jun 9th, 2007 @ 12:00 PM
page 1 of 1
Comments: 2 | Views: 4271

Hi,

I'm trying to build a drag-and-drop feature into a treeview. The first part is working and I'm getting the item dragged from one place to another. (At least, the task I am dragging is popping up again in the drop eventhandler) However I need to get the item on which the dragged item was dropped.

Anyone know how to do this?

Not by much, I got it fixed. My problem existed around two core points:

  • Hittest functionality to get the target node to drop the source node on
  • Mouse position retrieval, needed by the hittest functionality.

Both got solved, Josh Smith has a pretty good utility for the last point and the first point was solved using the VisualTreeHelper class.

I wrote an article on the problem, as I'm pretty sure that more people have the same problem.

http://blogs.infosupport.com/blogs/willemm/archive/2007/06/11/Implementing-Simple-drag_2D00_and_2D00_drop-operations-on-a-WPF-treeview.aspx

page 1 of 1
Comments: 2 | Views: 4271