Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6780407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:30:08+00:00 2026-05-26T16:30:08+00:00

I am doing a drag drop from one user control onto a different TreeView.

  • 0

I am doing a drag drop from one user control onto a different TreeView. However, how can I detect the drop into the tree view item? I can detect if there is a drop into the TreeView, but thats not the item. I can do an TreeViewItem.Drop event, but thats for when I drop an Item inside the TreeView, not from another control.

I tried seeing the TreeView to be focused, however, that did not solve it. I can detect DragEnter/Leave on the TreeView and it’s Items, but not the drop. I have taken a look at other topics that said to have a DragOver to potentially fix this, hwever, but that did not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:30:08+00:00Added an answer on May 26, 2026 at 4:30 pm

    Try this:

        private void treeView1_DragDrop(object sender, DragEventArgs e)
        {
            Point DropXY = ((TreeView)sender).PointToClient(new Point(e.X, e.Y));
            TreeNode DestinationNode = ((TreeView)sender).GetNodeAt(DropXY);
    
            MessageBox.Show(DestinationNode.Text);
        }
    

    [EDIT]
    Note: You must have the AllowDrop property of the TreeView set to true.
    And, you must handle this event:

    private void treeView1_DragOver(object sender, DragEventArgs e)
    {
        e.Effect = DragDropEffects.Copy;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with the jQuery Sortable plugin to drag and drop images from one
I'm doing drag/drop out of an activeX control. On drag, I provide a CComQIPtr
I have a page where the user can drag and drop objects and save
I've one functionality where user can save the state of Application, application consist of
I am doing drag and drop with NSView. In the object to be dragged,
this is my code for doing drag and drop functionality. i use jquery pugins
I'm building a web-app that will allow users to drag and drop from a
I've got a custom model inherited from QTreeView. I've enabled drag and drop and
So, from what I've seen nearly all the IE compatible drag-n-drop use positioning to
In this sample Ext Js grid: http://dev.sencha.com/deploy/ext-4.0.2a/examples/dd/dnd_grid_to_grid.html You can drag and drop items from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.