VS
Venkatesh S
Syncfusion Team
December 30, 2009 12:36 PM UTC
Hi Ron,
Thank you for your interest in Syncfusion products.
The child nodes can be retrieved before their parent node.
Following code snippet can be used to acheive your requirement
[C#]
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim allCheckedNodes As New List(Of TreeViewNode)()
childparent(TreeView1.Items, allCheckedNodes)
For Each tv As TreeViewNode In allCheckedNodes
Text1.Text += tv.Text
Next tv
End Sub
Protected Sub childparent(ByVal listItems As IList, ByVal list As List(Of TreeViewNode))
For Each tv As TreeViewNode In listItems
If tv.HasSubNodes Then
childparent(tv.Items, list)
End If
If tv.Checked AndAlso tv.ShowCheckBox Then
list.Add(tv)
End If
Next tv
End Sub
Please let us know if it helps you.
Regards
Venkatesh