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

Treeviewadv

Hi, I am trying to find a way of finding the previously checked node, so that I can uncheck it. To do this, I am trying to store the path of the checked node in a variable, and when another node is checked then I can refer back to the previously checked node with the path. The problem is that when you check a node it does not select the node. I have only found a way to refer to the selected node, but not a checked node. Thanks in advance (; Petrus

1 Reply

AD Administrator Syncfusion Team October 11, 2004 05:49 PM UTC

Hi Petrus, You could use the TreeViewAdv''s AfterCheck and BeforeCheck events for this purpose as shown below : // prevCheck denotes the previously checked node // currentCheck denotes the currently checked node TreeNodeAdv prevCheck, currentCheck; private void treeViewAdv1_BeforeCheck(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvBeforeCheckEventArgs e) { if (currentCheck!=null) { prevCheck = currentCheck; Trace.WriteLine("previous checked node : " + prevCheck.Text); } } private void treeViewAdv1_AfterCheck(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvEventArgs e) { currentCheck = e.Node; } Please refer to the complete sample attached that illustrates this, and let me know if it meets your requirements. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon