How to loop through Einhugur TreeView

Does anyone knows how to loop through Einhugur TreeView Control. I need to check which all nodes state are checked while saving something.

I did not test, but must be something like this:

[code]// TV is the Einhugur TreeView

Dim Y As Integer = TV.RootNodeCount-1
Dim rootNode As TreeViewNode
Dim C,X,Z As Integer

For X = 0 To Y

rootNode = TV.RootNodes(X)

Z = rootNode.NodeCount-1

For C = 0 To Z

 // Check the Node and move on to the next...
If rootNode.Node(C). ... Then
End If

Next

Next

TV.LockDrawing = False[/code]

I have my second node as TreeViewCheckboxNode. Now inside the second loop how do i get the properties of TreeViewCheckboxNode node details. Here you mentioned like this

For C = 0 To Z

// Check the Node and move on to the next…
Dim snode As TreeViewCheckboxNode

snode = rootNode.Node© //Here i am getting error : expected TreeViewCheckboxNode but got TreeViewNode

Next

Maybe you just have to do something like:

Dim myCheckNode As TreeViewCheckboxNode

And in the Loop then:

myCheckNode = rootNode.Node(C)

and then go on with this myCheckNode ?

I have done exactly the same but getting an error while compiling “Expected TreeViewCheckboxNode but got TreeViewNode” at the line myCheckNode = rootNode.Node©

Björn always delivers Examples with his Plugins. Did you already check them?

Yes. But it doesnt contain this kind to loop the control with the second node as checkbox node.

I can’t test anything right now, but @Björn Eiríksson is always very willing to help. You should get in contact with him.

I’m guessing here: you need to cast to the correct node type:

[code]Dim snode As TreeViewCheckboxNode

snode = TreeViewCheckboxNode(rootNode.Node©)[/code]

Excellent Beatrix that did the trick.