I'm adding all my nodes in the NodesNeeded event. Then, in the NodeFormatting event, I'm changing the image of the nodes using the ImageKey.
The problem is that NodeFormatting is not called for all visible nodes. It seems it gets called for arbitrary root nodes when I expand one of the roots or when I scroll up and down. What's going on?
UPDATE
If I explicitly set the ImageKey when adding the nodes (which I don't want to do), then all images are updated when I click inside the tree view. Calling Refresh() after adding the nodes does not help.
UPDATE 2
Another problem... when I double-click node A its icon changes to "Open" and is kept open until I select one of its child nodes. When a child is selected, the icon changes to "Closed". I have put breakpoints at all places where I set the icon to "Closed" and it does not fire. Hence, for some reason, the RadTreeView manages to revert the icon to its previous state...
The problem is that NodeFormatting is not called for all visible nodes. It seems it gets called for arbitrary root nodes when I expand one of the roots or when I scroll up and down. What's going on?
UPDATE
If I explicitly set the ImageKey when adding the nodes (which I don't want to do), then all images are updated when I click inside the tree view. Calling Refresh() after adding the nodes does not help.
UPDATE 2
Another problem... when I double-click node A its icon changes to "Open" and is kept open until I select one of its child nodes. When a child is selected, the icon changes to "Closed". I have put breakpoints at all places where I set the icon to "Closed" and it does not fire. Hence, for some reason, the RadTreeView manages to revert the icon to its previous state...