Adding nodes to Delphi treeview

[ DelphiLand Discussion Forum ]

Posted by Sal on January 09, 2003 at 19:22:01:

In Reply to: Re: Adding nodes to a treeview posted by WAllison on January 08, 2003 at 20:14:01:

Thanks for the help. I tried your advice,but it won't work. What's happening is a click on a menu item creates a new record in a table. Then a new node, representing that record, is added to the treeview. There can be an essentially unlimited number of nodes, but there are only three types (Initial, Annual or Special), all at the same level.

Each time a new record is added to the table, a procedure is called which appears to repopulate the treeview, not merely add the new node. I think this is where the problem occurs, because up till that point the new node is last and is selected (I think - it's inaccessible in the Watch List for part of the procedure). I can't use the index because it changes when the treeview is repopulated.
I can set it so that nothing is selected, forcing the user to manually select it, but once there are several nodes, there's no way to indicate which is the new node.

Related Articles and Replies:

[ DelphiLand Discussion Forum ]