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.
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); }
Hi Mike,
Thanks for your quick response.
this code working fine.but doesn't work when click on expansion indicators. if a node is selected, then you double click an expansion indicator(anywhere),that popup form is opening.
so how to fix that one.