Hi,
I have a tree which has 7 columns and viewstyle is in OutLookExpress Mode. The first column is enabled to show the expansion indicator. I have a requirement to show a dialogue on double click event over cell in 7th Column. After showing the dialogue box, it expands the node, which actually is not a requirement. So how can i restrict expanding the node on the double click event over a cell.
Thanks & regards,
Sriram Sarma.
Hi, thanks for the reply. My problem is resolved now. Basing on the column index, i am selecting the property of node expansion as None.
Sriram
The following code sample demonstrates how to use the UIElement.ElementFromPoint method to hit test for a particular element, in this case an UltraTreeNodeCellUIElement. Once you have a reference to the associated UltraTreeNodeColumn, you can decide whether to expand the node (set UltraTreeNode.Expanded to true) or "display a colorpalette":
private void ultraTree1_MouseDoubleClick(object sender, MouseEventArgs e){ UltraTree tree = sender as UltraTree; UIElement controlElement = tree.UIElement; UIElement elementAtPoint = controlElement != null ? controlElement.ElementFromPoint( e.Location ) : null;
UltraTreeNodeCellUIElement cellElement = null; while ( elementAtPoint != null ) { cellElement = elementAtPoint as UltraTreeNodeCellUIElement; if ( cellElement != null ) { UltraTreeNodeColumn column = cellElement.Column; UltraTreeNode node = cellElement.Node; }
elementAtPoint = elementAtPoint.Parent; }}
Hi Mike,
This property totally arrests the double click action on the node. But the requirement is when a parent node is double clicked which is in first column it should expand and the corresponding cell value in column 7 when double clicked should display a colorpalette. It means double click should behave in different way when clicked on firstcell and 7th cell for the same node (the tree is in outlook express mode).
Regards,
Sriram.
Hi Sriram,
this.ultraTree1.Override.NodeDoubleClickAction = NodeDoubleClickAction.None;