We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Double click and selection problem

Hello there,
I have TreeViewAdv in wich is not allowed multiselection. And I have such for example tree:
+ mainTreeNode1
- mainTreeNode2
childNode1
childNode2
In handler of DoubleClick event i am executing some action with selected node.
When i selected childNode1 and perfomed double click on "+" of mainTreeNode1 in DoubleClick handler childNode1 is selected in tree, but in this situation i not want perfomed some action with selected node, such as i double clicked on "+", not on selected node.
Please help how to prohibit executing some action with selected node if i double clicked on "+" of another root node.





1 Reply

J. J.Nagarajan Syncfusion Team December 13, 2007 10:28 PM UTC

Hi Alexey ,

You can show the selection of the child node of a parentnode when you double click on another parent node. To achieve this behavior, you have to use Background property of the child node to show the selection. Please refer to the following code snippet.

foreach (TreeNodeAdv treenode in treeViewAdv1.Nodes)
{
foreach (TreeNodeAdv treenode1 in treenode.Nodes)
{
if (treenode1.Text == "Node4")
treenode1.Background = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.Wheat);
}
}

The attached sample demonstrates this behavior completely.

http://websamples.syncfusion.com/samples/Tools.Windows/F70447/main.htm

Please refer to it and let me know if you have any questions.

Thanks,
Nagaraj


Loader.
Live Chat Icon For mobile
Up arrow icon