473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Drag and Drop in TreeView

Hi,
I have a TreeView control with hierarchy:
A
| - B // source
| - C
D // dest
| - E

Whenever draging B in to D, Item B is removed and B is added into D node.
To implement this task, I ,firstly, write a simple MouseDown event to start
a drag-drop action:
private void tree_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
DragDropEffects dde1=DoDragDrop(s, DragDropEffects.All);
}
Which such simple methods, I do not expect my task is achieved. I just
expected that my tree-view acted normally. But what happend ?
When I click (not drag) the item B (or C or D), item B is chosen. But, when
I move the mouse (after I click the item) out of the treeview, the selected
node in the tree turns back to item A.

Is there any mistakes ? Can any one help me to make the tree view acting
normally ?

Thank in advanced.
Jul 19 '05 #1
2 3990
George Shepherd's Windows Forms FAQ contains an entry entitled:

How do I implement Drag and Drop support between two TreeViews?

Check it out at:
http://www.syncfusion.com/faq/winforms/search/617.asp

=============================================
Clay Burch, .NET MVP

Syncfusion, Inc.
visit http://www.syncfusion.com for .NET Essentials
" #Hai" <Re**********@Mail.com> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
Hi,
I have a TreeView control with hierarchy:
A
| - B // source
| - C
D // dest
| - E

Whenever draging B in to D, Item B is removed and B is added into D node.
To implement this task, I ,firstly, write a simple MouseDown event to start a drag-drop action:
private void tree_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
DragDropEffects dde1=DoDragDrop(s, DragDropEffects.All);
}
Which such simple methods, I do not expect my task is achieved. I just
expected that my tree-view acted normally. But what happend ?
When I click (not drag) the item B (or C or D), item B is chosen. But, when I move the mouse (after I click the item) out of the treeview, the selected node in the tree turns back to item A.

Is there any mistakes ? Can any one help me to make the tree view acting
normally ?

Thank in advanced.

Jul 19 '05 #2
You can find the solution in http://longreat.com, or sutiable item for you.

" #Hai" <Re**********@Mail.com> ¦b¶l¥ó
news:u5**************@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
Hi,
I have a TreeView control with hierarchy:
A
| - B // source
| - C
D // dest
| - E

Whenever draging B in to D, Item B is removed and B is added into D node.
To implement this task, I ,firstly, write a simple MouseDown event to start a drag-drop action:
private void tree_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
DragDropEffects dde1=DoDragDrop(s, DragDropEffects.All);
}
Which such simple methods, I do not expect my task is achieved. I just
expected that my tree-view acted normally. But what happend ?
When I click (not drag) the item B (or C or D), item B is chosen. But, when I move the mouse (after I click the item) out of the treeview, the selected node in the tree turns back to item A.

Is there any mistakes ? Can any one help me to make the tree view acting
normally ?

Thank in advanced.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Plumer | last post by:
Hello everyone, Yesterday I posted a message about implementing drag & drop in a TreeView control. I'm having real difficulty getting this to work -- the process seems to be incredibly...
1
by: Kevin Henkener | last post by:
I would like to be able to drag-n-drop System.Windows.Forms.TreeNode objects between two different applications (actually the same application, just two instances of it) in C#. I've seen posts in...
0
by: Norbert Heidbüchel | last post by:
Hi all, I have read a lot of postings and web pages about drag and drop and treeviews, but could not find an answer to my problem. Sorry, if I missed something. I am trying to drag and drop...
4
by: Qingdong Z. | last post by:
I have a VS.NET windows application which use drag-drop feather. It works fine when application start, but stops working after application run one or two days. The application is related to Video...
1
by: emferrari | last post by:
Hi everybody I have two treeviews, one of them is only to receive items dragged from the treeview1. I want to know how to drag a full node information to the treeview2. I know how to do that...
1
by: Terry Olsen | last post by:
My first time using TreeViews. I have TreeView1 set up to display my directory structure just like Windows Explorer. I can drag & drop files and folders over to TreeView2. I can re-arrange the...
1
by: pooja | last post by:
i need to implement drag and drop in treeview in VB. Kindly help. My treeview contains activities maintained using XML Files. Hopefully, Thanks.
1
by: timnels | last post by:
I have created a muti-select treeview control. Problem is I am now trying to implement drag/drop in the application that uses it. It seems the mouse down and mouse move events fire before the...
0
by: munishbatra2002 | last post by:
hi all, we are using a gridview and a treeview control ... we want to drag a row from gridview control and drop it onto treeview control on a web page... we are using C# ASP.NET ... can anyone...
2
by: bob | last post by:
Hi all, I have a treeview that has drag drop. Works well enough but... If you drag out of bounds of the treeview the nodrop icon comes on. Fair enough. But when I move back inside the treeview...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.