I have a database table with data and need to load the fields into a TTreeView object.
The line:
ItemTree.Items.AddChild(nil, CurrentField_Text);
simply adds a node to the top level.
How can I specify a point to insert it in?
Please note that while looping through the data from the table, I may (for example) insert 3 top level items and then the 4th element is actually the child of node 2.
How can I specify this?
This is some code lifted directly from a program of mine which inserts values taken from a query into a treeview.
If the ‘father’ field of the returned tuple is 0, then a new parent node is opened on the tree, otherwise a new child node is opened.