Hi,
I'm trying to develop a kind of windows explorer to manage folder structures together with files (according to the windows explorer).
I'm using two controls: an ultratreeview and an ultalistview.
My problem is the drag and drop functionality.
The drag drop functionality in the tree itself works suitable.
The possiblity of selecting / dragging listviewitems and dropping them on a special treenode on the treeview works not properly. If I put down the mouse button and move from the listview towards the treeview, the short icon, that shows if this item could be placed here or not, stays in the Effects.None mode.
This penomena is very strange to me, because if I first move (with drag and drop) within the tree, then after this action all listviewitems can be taken and put in the tree, as it is my wish.
Why doesn't this work initially without acting in the treeview before ?
In the ultratreeview I use the following events:
SelectionDragStart -> DoDragDrop (Tree)
DragOver
DragDrop
In the ultralistview I use the following events: (My Plan: The drag and drop functionality only works for putting listviewitems and dropping them in the ultratree NOT the other way round; so I think I need no dragover and dragdrop here for the ultralistview.
mouse_down
mouse_move ->dodragdrop (Tree)
which event can I use here for strating the dragging process ? is it ok to call the dragdrop functionality of the tree ?
Altogether again: The functionality really works, but only if first of at least one tree node is dragged (I guess the condition is that the SelectionDragStart() tree-function must be called first).
Or should I trigger this event in the mouse_move event of the ultralistview or is there an analogous function like SelectionDragStart() for the ultralistview items?
Can those dragover events etc... be debugged ? I do not think so, because those are called every time, messageboxes wihtin often lead to system exceptions and exit the programm ..... How can I verify that the contents of these functions work properly ?
I would be thankful for any kind of help.
Thank you very much,
Best regards,
Tobias Rüger
Thank you for this answer, however also the examples gave no additional help to my problem.
Could you please give me further advice concerning this concrete problem.
Thank you very much.
UltraListView has no intrinsic support for drag and drop, so whatever problems you are having must be attributable to your implementation. There is a sample that ships with the product, 'WinListView DragDrop', which demonstrates how to properly implement drag and drop functionality; the code is heavily commented so you should be able to get a good understanding of the concepts used therein.
Regarding debugging the drag/drop events: you don't necessarily have to use a MessageBox, although doing so should not be causing exceptions and that might be indicative of other unrelated problems. Typically when debugging events that fire during a drag/drop operation, one uses the static methods exposed by the System.Diagnostics.Debug class to write information to the output window so that capture is not taken away from the control.