Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems using Treeview 2.0 control

Status
Not open for further replies.

tunsted

Programmer
Mar 31, 2004
9
GB
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top