This is a migrated thread and some comments may be shown as answers.

Hovering a dragged item

2 Answers 52 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Alex Galie
Top achievements
Rank 2
Alex Galie asked on 16 Dec 2009, 06:33 PM
Hello,

I have a scenario on my hands that is similar to this:

TreeView on the left containing folders
ListBox on the right containing files in current folder

I need the following to happen:

When dragging a file from the list box over the folder tree view, the contents of the list box has to change with the files inside the folder that I'm hovering my mouse on (while dragging a file that is).

What do I have to do for this ? I know that drag and drop operations capture the mouse, so MouseMove, MouseEnter etc. don't work while dragging.

2 Answers, 1 is accepted

Sort by
0
Accepted
GEB
Top achievements
Rank 1
answered on 16 Dec 2009, 10:32 PM
Alex, let me see if this solves what you are trying to do.  When you drag an item using the RadDragAndDrop manager, you will get an event when the dragged item is over a valid drop target.  In this case, that would be a folder within your TreeView.  Upon receiving that event (DropPossible), you can determine the target folder, and update the file ListBox appropriately.  As the item is dragged over a different folder, you will receive another DropPossible event, and you could then modify the ListBox to display the files for that folder.  If the file is dragged over an item where a drop is not possible (not a valid drop target), you could clear the file ListBox so that no files are shown. Does this answer your question?
0
Alex Galie
Top achievements
Rank 2
answered on 17 Dec 2009, 01:08 PM
Hi GEB,

I tried it and it seems to work, thanks for your help.
Tags
DragAndDrop
Asked by
Alex Galie
Top achievements
Rank 2
Answers by
GEB
Top achievements
Rank 1
Alex Galie
Top achievements
Rank 2
Share this question
or