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.
Syncfusion Feedback

How do I know multiselect inside AfterSelect event?

Thread ID:

Created:

Updated:

Platform:

Replies:

42631 Apr 3,2006 08:02 PM UTC Apr 4,2006 08:37 AM UTC Windows Forms 1
loading
Tags: Tools
Administrator [Syncfusion]
Asked On April 3, 2006 08:02 PM UTC

Hi, I am using treeviewadv. In AfterCheck event, I would like to know whehter there are more than one node selected when this node is selected? For example, I use Ctrl click to select multiple nodes, I would like to do something only when the first node is selected. Is there any way to do it? Thanks Chris

Deepa TS [Syncfusion]
Replied On April 4, 2006 08:37 AM UTC

Hi Chris, In AfterCheck event, you could know whether there are more than one node selected, when a particular node is selected using the following code snippet. private void treeViewAdv1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left) // get the point where the mouse was left clicked Point p = this.treeViewAdv1.PointToClient(Control.MousePosition); // get the node at the left click point TreeNodeAdv node = this.treeViewAdv1.PointToNode(p); if (node != null) { // see if the label was clicked on if (node.TextAndImageBounds.Contains(p)) { node.Checked =!node.Checked; } } } int i=0; private void treeViewAdv1_AfterCheck(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvEventArgs e) { i++; TreeNodeAdv node=new TreeNodeAdv(); Console.WriteLine("AfterCheck fired"+i.ToString()); } //If the selected node is first node it allows to make changes else no changes private void treeViewAdv1_AfterSelect(object sender, System.EventArgs e) { if(this.treeViewAdv1.SelectedNode==this.treeViewAdv1.Nodes[0]) { MessageBox.Show("Make changes"); } else { MessageBox.Show("No changes"); } } Please take a look at the sample and let me know if this helps you. Thanks for your interest in Syncfsuion products. Regards, Deepa.

LabelCheck.zip

CONFIRMATION

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.

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

;