AdvTreeView Node Data in virtual mode

Is there any way to assign virtual nodes data (String, Boolean, DBKey, etc) when working with virtual mode? There's no OnGetNodeData event, and if I try to assign a value to ANode.Node.DataXXXX on any other event, even after checking if the Node is valid, I get Access Violation.

I'm handling it by assigning the values I need to hidden columns (as Text, at OnGetNodeText event).
I just wonder whether there would be another more elegant way to do so.

The Data* properties are actually tied to the collection item. If you are working with virtual mode, the ANode.Node parameter will be nil, as there is no item in the collection. To use the Data* properties you'll need to switch to a collection-based treeview, or alternatively create your own data-structure that can contain your additional data, and then map this on the virtual treeview.

Ok.
Now I see everything I've been using inside those events are ANode.Level and ANode.Index. Not really checking or using the .Node property itself.
Seems I'll keep using hidden columns while not moving to collection mode.
Thanks!

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.