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
755
ultraTreenode double click
posted

Hello sir,

Good morning,

I'm using ultra-tree in my windows appl.In my appl there is a requirement that when user double click on a node,it need to be open a popup from.I'm trying to use tree-view double click event,but the problem is if user select anode and double click outside the node(even the tree-view scroll bar also) that popup is opening which i don't want.

So can anyone tell me is there any other event can i use for this purpose or how can i stop double click event if user click on Scrollbar.

plz help me with sample.

thanks in advance.

Parents
  • 469350
    Offline posted

    Hi,

    Presumably, you only want to respond to the DoubleClick event of the tree if the user double-clicks on a node.

    The event is not node-specific, it fires when you double click anywhere in the control. So what you need to do is determine the location of the mouse and see if it's over a node.

    Here's how you do that:


            private void ultraTree1_DoubleClick(object sender, EventArgs e)
            {
                UltraTree tree = (UltraTree)sender;
                UIElement element = tree.UIElement.LastElementEntered;
                if (element == null)
                    return;

                UltraTreeNode node = element.GetContext(typeof(UltraTreeNode)) as UltraTreeNode;
                if (node == null)
                    return;

                MessageBox.Show(node.Text);
            }

Reply Children