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

Constricting selection to resrective nodes alone.

Hi, When I click along the line of the node, first selected nodes are getting selected again and again. I used the pointToClient method. I am not able to attach my sample. Please help me to select the respective nodes alone when I click along the line of node. Thanks, Regards, Sam

2 Replies

DT Deepa TS Syncfusion Team March 7, 2006 10:19 AM UTC

Hi Sam, When along the line of the node is clicked, the respective nodes can be selected either using PointToClient method by handling MouseDown Event or by using GetNodeAtPoint in the treeViewAdv click Event handler. Using PointToClient Method: private void treeViewAdv1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { //Getting the mouse clicked point Point p = this.treeViewAdv1.PointToClient(Control.MousePosition); //Getting the node at the click point TreeNodeAdv node = this.treeViewAdv1.PointToNode(p); // set the newly selected node this.treeViewAdv1.SelectedNode = node; } Using GetNodeAtPoint Method: private void treeViewAdv1_Click(object sender, System.EventArgs e) { this.treeViewAdv1.SelectedNode=this.treeViewAdv1.GetNodeAtPoint(this.treeViewAdv1.PointToClient(Cursor.Position)); } Please take a look at the attached sample and let me know if this helps you. Thanks for your continued interest in Syncfusion products. Regards, Deepa.T.S

LineOfNode.zip


AD Administrator Syncfusion Team March 27, 2006 09:16 AM UTC

Thats good!!

Loader.
Live Chat Icon For mobile
Up arrow icon