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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Retaining the selection to the new node using TreeviewAdv Demo

Thread ID:





38570 Dec 15,2005 05:37 AM UTC Dec 22,2005 10:00 AM UTC WinForms 2
Tags: Tools
Asked On December 15, 2005 05:37 AM UTC

Hi, Using the TreeViewAdv with the context menu removed from the tree; when you right click on a node, the selection changes to the node that is being clicked. On releasing previously selected node(old node) is getting selected. But I don''t want this to happen. I want the selection changed to the new node, like the original TreeViewAdv demo with the context menu inplace. I am using TreeviewAdv Demo. Thanks in advance, Regards, Krishna.

Deepa TS [Syncfusion]
Replied On December 15, 2005 08:52 AM UTC

Hi Krishna, Please refer to the sample attached along with this, that shows how you could accomplish the above by handling the TreeViewAdv''s MouseDown event as shown below : private void treeViewAdv1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) { //Getting the mouse right clicked point Point p = this.treeViewAdv1.PointToClient(Control.MousePosition); // Getting the node at the right click point TreeNodeAdv node = this.treeViewAdv1.PointToNode(p); // set the newly selected node this.treeViewAdv1.SelectedNode = node; } } Let me know if this meets your requirements. Thanks for your interest in Syncfusion products. Regards, Deepa.T.S


Administrator [Syncfusion]
Replied On December 22, 2005 10:00 AM UTC

Hi Deepa, Its working great now. Thanks a lot. Regards, Krishna.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon