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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create new nodes on TreeView object 1

Status
Not open for further replies.

MARTINRODDY

Programmer
Apr 3, 2001
30
US
Hi
I have only srarted using the TreeView object recently. I am starting to get used to it. One question. Can someone tell me the command that allows a new node to be created during runtime. (and any other useful command if you no them)

tree.Items[1].Delete;

works fine when deleting a node, but some parameters are required
when using the create command.

Finally, is it possible to link the TreeView to a database? For instance
build a father-son relationship between hierarchial related records from a table?

Thanks
Martin
 
Node := treeView.Items.AddChild(ParentNode, 'New Node Description');

This will add a new node, and the function returns a pointer to that node. You have to pass in the parent node - if ParentNode is nil I believe it adds a new root node.

I don't know if there are any components out there that will display a table in a treeview or not.

TealWren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top