I am having problems getting the treeview control to work reliably. The nodes are built dynamically. I'm building the top level nodes initially as the page loads. I'm then using the _TreeNodePopulate() event to add new child nodes as I click on a parent. THis is all working fine. As I add a new node I'm assigning the text property and the value property (in this case an integer). I'm also adding the value property to the tooltip for testing purposes. Again, this is all working fine and I can see the correct text values and tooltip values. My problem starts when I click on a node and call the _SelectedNodeChanged event. This is working for a few selections and then starts giving me random values. I've put a message box in the event procedure so that I can see instantly what node (value) it thinks I've clicked on. Most of the time these are valid nodes, if not the correct ones, and are different to the value show in the tooltip, but occasionally the selectednode will be null or nothing, giving me an error.
What am I doing wrong, or is this a known error?
What am I doing wrong, or is this a known error?