Ana D. 0 Junior Poster in Training

Hi,

I'm binding a TreeView using the SiteMap Data. Near to each node, I have a checkbox so that the user can select the node he wants.
I need to iterate through the tree checking if the node is checked and if so, write something like: Home - Node1 - Node2; if it's not checked, go to the next node.
I'm iteration through the tree using the following method:

Protected Sub goThroughTree(ByVal node As TreeNode)
        'Do something
        If node.ChildNodes.Count > 0 Then
            For Each child As TreeNode In node.ChildNodes
                goThroughTree(child)
            Next
        End If
    End Sub

Problem: how to write "Home - Node1 - Node2" for each checked node in the tree?

Besides, I have two types of nodes, let's say typeA and typeB. I even need to write:
- if node is typeA, write typeA - Home - Node1 - Node2
- if node is typeB, write typeB - Home - Node1 - Node2

Any help would be much appreciated.

Thanks,
Ana

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.