Here's the issue. You have a tree that has certain leaves open.
You get a selectedIndex from a tree lets say its 9. This means that the 10th visible slot on the screen is selected, regardless of what is or isnt open. Its 10 rows from the top of the screen. Then, you put that captured selectedIndex back. Its 9. But now the 9 seem not to mean the 10th row, but the 10th item at the top level of the data structure. So if your first leaf in the tree is open and it has 10 children, you will be selecting the 20th row on the screen. In other words, reading a selectedIndex seems to be different from setting a selectedIndex. This is interesting also because it is very similar to my issue yesterday about the openItems being different when you read it than when you set it. It appears to me there are a bunch of issues in the tree control related to the fact that it is a heirarchical object being mapped to a flat underlying list structure. Another similar issue is that the iterators do not iterate over all the items in the tree, just the ones at the top level. An iterator that doesnt iterate over all the objects in the list doesnt seem to me to be very useful. I think all of this exposes some problems with the conceptual underpinnings of the tree object. I would love to hear if others have had similar issues. Hank