I wonder if it is possible to find a TAdvTreeViewVirtualNode in a TAdvTreeViewusing Row and Index?
A TAdvTreeViewVirtualNode has .Index and .Row properties which can be saved. It would be nice to retrieve the TAdvTreeViewVirtualNode with Row and Index as an argument.
I ask this question because I noticed that the argument in an AfterSelectNode event is subject to change.
I have this code:
procedure TForm1.TVprogrammasAfterSelectNode(Sender: TObject;
When MyFunction2 is called ANode sometimes has changed. I would like to retrieve it again using Row and Index (or something else? Tell me)
The index is relative to its parent, the row is relative to the root of the treeview. You can use the FindVirtualNodeByRow or FindNodeByRow functions to retrieve the node for a specific row. If you are working with a collection, you can persist a reference to the node instead by using the following code:
procedure TForm1.TVprogrammasAfterSelectNode(Sender: TObject; ANode: TAdvTreeViewVirtualNode);
n := ANode.Node;
As n will always refer to the same collection item, even if the index/row changes.
As I reload the Nodes sometimes, the reference to the Node does not work and I can't find the
FindVirtualNodeByRow function? It's not listed with TAdvTreeView...
the FindNodeByRow and FindVirtualNodeByRow have been added in v22.214.171.124 of TAdvTreeView (TMS Component Pack v126.96.36.199)
Ah, I have 188.8.131.52. I will update, thank you.