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.
Unfortunately, activation email could not send to your email. Please try again.

Constricting selection to resrective nodes alone.

Thread ID:





41606 Mar 7,2006 01:15 AM Mar 27,2006 04:16 AM Windows Forms 2
Tags: Tools
Administrator [Syncfusion]
Asked On March 7, 2006 01:15 AM

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

Deepa TS [Syncfusion]
Replied On March 7, 2006 05:19 AM

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


Administrator [Syncfusion]
Replied On March 27, 2006 04:16 AM

Thats good!!


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.

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.