SelectedKey = This.SelectedItem.KeyThen I clear all the nodes and rebuild the tree.
This.SelectedItem = This.Nodes[SelectedKey] This.SelectedItem.ensurevisibleHowever sometimes the SelectedKey doesn't exist once the tree is rebuilt. Is there an easy way to determine that? I can't spin through all the keys because I build each branch dynamically as it is expanded. The only thing I've can think of is setting it, catching the error if it doesn't exist, and going on from there.