Drag n drop on listview - OnMouseDown ?

Started by copter, March 15, 2017, 12:48:32 PM

Previous topic - Next topic

copter


Since the OnMouseDown event  is triggered only if the mouse comes from outside the listview but not if the mouse comes from the listview, how can I catch a DragNDrop inside a listview ?

owenwengerd

You might check whether DragnDropFromControl also gets called when dragging from the same control.
Owen Wengerd (Outside The Box) / ManuSoft

copter

If  this event is triggered the droped image is deleted.
Dont understand why.
I give up.
Thanks anyway for your help.

Fred Tomke

Hi, copter I recommend you to search the forum for drag and drop and to have a look at the samples.
You'll find at least two different ways to use drag'ndrop functionality in OpenDCL.

Automatic way:
The behaviour you mentioned works as designed: the dragged item will be moved off the source control. The idea was to move the selected item from one to another or within a control.
Have a look at the opendcldemo command and check out the Drag&Drop sample.

I do never use this, because I always have a database in the background (access or sqlite or mysql) which has to update structures or object relationships. Thats why I alsways use the

Manual way:
I can activate some events to control the behaviour when start dragging, while dragging and when dropping. But because I can do this, I have to do this. This might cause some researches and test but you will recognize the necessity to do this.

Maybe I find the time today to rewrite a small sample.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

copter

Thanks Fred
Yes it should be very helpful if you have any sample.