Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
Drag and Drop Functionality within UltraTree
posted

Hi,

i have drag and drop functionality which works fine within ultratree.  when i  tried to use through form. whenever you select drag and drop a folder or some file in the ultra tree the form appears which has two options, either copy or move. based on the selection, copy or move should happen. how to proceed. help me.....

  • 821
    Offline posted

            private void treeView_DragOver(object sender, DragEventArgs e)
            {
                Point newPoint = treeView.PointToClient(Cursor.Position);
                UltraTreeNode nodeAtPoint = treeView.GetNodeFromPoint(newPoint);
                if(nodeAtPoint == null)

                  return;

                if (nodeAtPoint == "whateveryouwanttoCheck")
                {
                    e.Effect = DragDropEffects.Move;
                }
                else            {
                    e.Effect = DragDropEffects.Copy;
                }
            }

     

    Keep in Mind that this method is called on every mousemove. The ultratree does sadly not support a "UltraTreeNodeDragEnter/DragLeave".