I have an ASP.NET TreeView control with the "ShowCheckboxes" state set to "All".
If I check the boxes on the tree, then the tree.CheckedNodes property is always "False". I've also tried looking at the individual Nodes(i).Checked property, but those are also all false.
If I manually set the Checked property to True from code, then it does get reflected in the .CheckedNodes property.
I feel like I must be missing something obvious- why would this simple boolean property fail to reflect what I've done in the UI?
Protected Function GetChosenIDs() As List(Of Guid)
Try
Dim result As List(Of Guid) = New List(Of Guid)
'This loop never executes, because nothing is marked "Checked".
For Each node As TreeNode In tree.CheckedNodes
result.Add(New Guid(node.Value))
开发者_高级运维 Next
Return result
Catch ex As Exception
Throw ex
End Try
End Function
精彩评论