Click to See Complete Forum and Search --> : Listview - drag and drop question


Dracan
October 1st, 2005, 10:33 AM
Hi. I've got a listview control that you can drag onto, and drag from. I want to be able to differentiate between the following two scenarios ...

- An item being dragged from another control into this listview item (so I can add it to the list).
- An item being dragged from this listview item onto itself (so I can reorder the list).

What's the best way of doing this?

Thanks for any help.
Regards,
Dan.

jmcilhinney
October 1st, 2005, 08:48 PM
I've actually never implemented drag & drop myself, but I'd assume that you would set some boolean variable when you start the drag operation from the ListView itself. Then, when you perform the drop operation, you would test that variable and re-order if it's true. You'd then set it back to false.