In the SampleApp, the FolderBrowser control has the _treeView[TreeViewAdv].SelectionMode property set to 'Single'. If a single record is selected and space key is pressed, it triggers the nodeCheckBox1.KeyDown event. Inside that event, a foreach is supposed to loop through all selected nodes and set the Checked state. However, because of how the model is implemented (as a SortedTreeModel I think), it ends up triggering OnStructureChange events which eventually rebuild the node collection. This in turn looses the selection state, causing Parent.Selection to change which causes the foreach in the KeyDown event to throw an exception.
First of all, it is bad practice to enumerate over a list which can change during the enumeration. Second, just changing the checked state in the single-selection scheme really does not need to trigger a entire rebuilding of the list. I guess it is coded that way because if a sorted tree is sorted on the check state, the "structure" (i.e.sort order) should indeed change. But on the other hand, simple behavior as checking a box for a single item should not cause the selection to be lost or the tree to be rebuilt is most cases. The general model needs to be improved to avoid triggering unnecessary events that rebuild node lists. Perhaps the SortedTreeModel needs to be made smarter to only rebuild the list when the sort order actually changes (or more specifically, OnStructureChange events don't need to be called unless there really is a change in structure or only if a sorted value is changed.
Likewise, perhaps the selected nodes should also be restored after a change just as expanded nodes are restored after a change. I realize this is more of a feature request, but it is intimately related to this bug and solution.