OK, the title's a little bit of a lie.
I am unable to figure out the right combination of property values and event handlers to get a behavior I need for dragging things around in a radtreeview.
I want to allow users to drag node around in the tree (not into other controls). This would seem to be very easy by simply setting the AllowDragDrop property to true. This works great -- except that I need to implement some constraints. Specifically, each type of node knows whether a given other node can be dropped onto it.
I was unable to find any event I could effectively hook to implement this. The documentation suggests that at the end when the drop happens (DragEnding) it's possible to apply some logic to determine if the drop is valid. However this is not enough for me. I want to provide real time feedback when the user is hovering over various nodes about whether they can drop there.
So I started trying tsome things. First I tried adding some feedback in the DragOver event. But as soon as I did that, the visuals provided by the control (basically the bitmap being dragged around) moved a few pixels but then froze. I finally concluded that I was colliding with the fully automatic drag drop capabilities in the control enabled by setting AllowDragDrop.
So I turned off AllowDragDrop and initiated a DoDragDrop manually on the MouseMove event. Then I started implementing the other normal Windows events (like DragOver). In order to provide feedback, I change the colors of the potential target node. This all works well *BUT* I can't figure out how to catch when the user cancels the drag-drop so I can restore the node to its original colors. I can do this if the operation completes by changing it back in the DragDrop event, but I don't think that happens if the user hits escape while dragging.
So... I thought I could hook QueryContinueDrag because it seems to have a flag indicating whether the user pressed Escape. And here's the problem. The event never seems to be called. Is that a bug? Is there something I need to do to cause the events to be fired? My concern is that there is a bug such that QueryContinueDrag doesn't fire if the drag-drop operation is manually initiated (as I'm doing now).
Any advice? Is there a simpler way to make this work? Is there a bug with firing QueryContinueDrag?
Help!
Thanks,
David