hi all,
How do I enable the most basic drag and drop on a WinTree Control?
I followed the drag and drop sample, but when I drag, the node doesn't move, only the node that's under the mouse pointer is highlighted.
thanks in advance.
Tony.
Thank you very much.
I think I got it now.
The 'UltraTree Drag and Drop' sample, which ships with the SDK, demonstrates how to do this, using the UltraTreeNode.Reposition method to change the node's position within the collection, and the IUIElementDrawFilter interface to draw a drop indicator. The sample I originally directed you to demonstrates how to drag between two controls, so you might be better off taking a look at the 'UltraTree Drag and Drop' sample.
Hi,
In my case, I only have a single ultra tree on my form. I only need to drag and drop the nodes of this single tree to re-arrage the node positions. I'm not dragging the nodes away to other controls. and I'm not dragging items from other controls into this tree. Does this sample app still apply? or is there an easier approach?
thanks in advance
There is a sample that ships with the SDK for the WinListView control, named 'WinListView DragDrop', which demonstrates this concept with a WinListView control. The sample was designed so that it could be easily modified to support a different control, with UltraTree being a perfect example. The .NET drag drop stuff is abstracted out into two interfaces which you implement for a given control, and you can get semi-transparent nodes to appear while they are being dragged. You should try to modify that sample for UltraTree and if you run into any problems, post here and we can try to help.