anyone know where i can get help on making objects within the database(displa ys in tree view) able to be dragged and dropped in new locations? e.g. drag location A from house A to House C?
Drag and drop
Collapse
X
-
Nodes only understand .Add and .Remove
You would have to take the currently selected node...
.Remove it from the node it belongs to, and
.Add it to the node you want it on
Here is how I determine a node based on mouse arguments so I can do a right-click which treeview's don't support in their events.
You should be able to tear this apart to work out the node selected at mouse down, and again at mouse upCode:private void treeView1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { TreeNode selectedNode = treeView1.GetNodeAt(e.X, e.Y); //MessageBox.Show("You clicked on node: " + selectedNode.Text); } //else we ignore it for convenience } }Comment
Comment