Drag Drop in explorer layout

Posted on 2007-08-09
Last Modified: 2013-11-26
Hello everyone,

Forgive me if this information can be easily found - I have searched but to no avail.  I am creating an application that has an explorer layout; that is to say that I have some folders in a tree view control and items in a list view control that are obviously linked.  The folder structure and items are stored in a database and I use the explorer style setup to best organise the items.

I have since determined that I need to give users the opportunity to move items from one folder to another.  This should be relatively straight forward because there is only one item type.  I have attempted to put this together myself and managed to transfer information across from the list view to the tree view on drag drop.

I have not, however, been able to achieve all I would like.  For example the tree view doesn't automatically highlight folders for the drag drop as explorer does obviously enabling you to clearly see which folder your items are being dropped to.  I tried implementing this by 'selecting' the node that the mouse is currently over but the 'AfterSelect' even fires and I use that to add items to the list view control after the user clicks on a that caused problems.  I've played around with other ways to do this but fear there is a simple solution somewhere out there.

Any help would be appreciated.

Kind regards,

Question by:Ady Foot
    1 Comment
    LVL 16

    Accepted Solution

    I have actually found a solution to this problem.  If anyone is interested for future reference there is an excellent example here:

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now