Notifications
Clear all

[Closed] How to get all checked nodes fullpath from a treeview?

Hi
I am trying to get all checked nodes fullpath from a treeview,how can I do that?Thanks for any help

test_checked

 	rollout test_rollout "Test View" width:400 height:250
 	( 
 		dotNetControl test_view "TreeView" pos:[0,0] width:400 height:250 		
 		on test_rollout open do
 		(
 			test_view.CheckBoxes=True 			

 			testNode_01=dotNetObject "TreeNode" "test_01"
 			testNode_02=dotNetObject "TreeNode" "test_02"
 			testNode_03=dotNetObject "TreeNode" "test_03"
			
 			testNode_04=dotNetObject "TreeNode" "test_04"
 			testNode_05=dotNetObject "TreeNode" "test_05"
			testNode_06=dotNetObject "TreeNode" "test_06"
			
			testNode_07=dotNetObject "TreeNode" "test_07"
 			testNode_08=dotNetObject "TreeNode" "test_08"
			testNode_09=dotNetObject "TreeNode" "test_09"
			
 			testNode_03.Nodes.Add testNode_04
 			testNode_03.Nodes.Add testNode_05 			
			testNode_03.Nodes.Add testNode_06 

			testNode_06.Nodes.Add testNode_07
 			testNode_06.Nodes.Add testNode_08 			
			testNode_06.Nodes.Add testNode_09 
			
 			root_Node=dotNetObject "TreeNode" "Root"

 			root_Node.Nodes.Add testNode_01
 			root_Node.Nodes.Add testNode_02
 			root_Node.Nodes.Add testNode_03 			

 			test_view.Nodes.Add root_Node

 			test_view.ExpandAll()
 		) 		
 		on test_view AfterCheck arg do
 		(
 			--How to get all checked nodes fullpath?
 		)
 	) 	
 	try(destroyDialog test_rollout)catch()
 	createDialog test_rollout
3 Replies

i havn’t found primitive method , then you can traversal nodes by yourself

sel=#()
fn getchecknodes n =
(
	for i = 0 to n.nodes.count - 1 do
	(
		if n.nodes.item[i].Checked do
			sel[sel.count+1]=n.nodes.item[i]
		if n.nodes.item[i].nodes.count > 0 then
			getchecknodes n.nodes.item[i]
	)
)
getchecknodes test_rollout.test_view
for o in sel do print o.FullPath

There is an example of make a list of checked treeView nodes of C# example for reference

Works like a charm,thanks!