Hovering a dragged item

3 posts, 1 answers
  1. Alex Galie
    Alex Galie avatar
    22 posts
    Member since:
    Dec 2009

    Posted 16 Dec 2009 Link to this post

    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. Answer
    GEB
    GEB avatar
    228 posts
    Member since:
    Dec 2008

    Posted 16 Dec 2009 Link to this post

    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?
  3. DevCraft banner
  4. Alex Galie
    Alex Galie avatar
    22 posts
    Member since:
    Dec 2009

    Posted 17 Dec 2009 Link to this post

    Hi GEB,

    I tried it and it seems to work, thanks for your help.
Back to Top