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
1290
Select node(with right click) clashes with dragging property
posted

Hi,

I am using the drag drop function that is found in the examples shipped with the Infragistics control. Within FormLoad, I have this line of code here:

      trvModules.Override.SelectionType = Infragistics.Win.UltraWinTree.SelectType.ExtendedAutoDrag;

 

And in my MouseUp event handler, I have:

  if (e.Button == MouseButtons.Right)

                {

                    Point p = new Point(e.X, e.Y);

                    UltraTreeNode node = trvModules.GetNodeFromPoint(p);                   

                    node.Selected = true;

                  }

}

 

The problem is: none of the nodes gets deselected. I can right click multiple nodes of the tree, and all of them remains selected.

However, when I comment out this line:

      trvModules.Override.SelectionType = Infragistics.Win.UltraWinTree.SelectType.ExtendedAutoDrag;

the node selection works as expected, that is the nodes gets selected(highlighted) exclusively. But uncommenting that line affects the drag-drop effect. How can I solve this issue?

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    You could also use the ISelectionManager meneger interface to select the node and clear the existing selection in one atomic operation:

    private void ultraTree1_MouseDown(object sender, MouseEventArgs e)
    {
        UltraTree tree = sender as UltraTree;

        if (e.Button == MouseButtons.Right)
        {
            UltraTreeNode node = tree.GetNodeFromPoint(e.Location);                  

            if ( node != null )
            {
                ISelectionManager selectionManager = tree as ISelectionManager;
                selectionManager.SelectItem( node, true );
            }
        } 
    }

Children
No Data