TAdvTreeView Metadata

In collection based usage of TAdvTreeView how can I add metadata like for example JSON objects in a TAdvTreeViewNode, like we can with AddItem in a list box?


each TAdvTreeViewNode object has access to Data* properties such as DataString, DataInteger, DataObject, DataPointer, which can be used to add custom data.

I have tried to put a Json string into a node like this:
sn := Tree.AddNode(pn);
sn.DataString := jv.ToJSON;

But when I try to read back the json string with aNode.DataString in the AfterSelectNode event the string is empty.

You need to use ANode.Node.DataString, ANode is the virtual node reference

That works!
Thanks a lot Pieter:)

1 Like