2

I need to select a specific node in VirtualTreeview programmatically, but I don't find any method to do so. Anybody could help with a solution?

Filburt
  • 17,626
  • 12
  • 64
  • 115
Willer Bononi
  • 31
  • 1
  • 4

1 Answers1

6

Select nodes like this:

VirtualTree.Selected[Node] := True; 

If you have a multi-select tree then precede this by clearing any existing selection:

VirtualTree.ClearSelection;
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • This worked for me to select the node but later in the code I am attempting to grab the .FocusedNode but this is nil. Is there something else I can do to 'focus' the node also? The node seems to be focused when I actually click the node but not when doing it programatically using .selected[Node] := true. – Charles S May 08 '19 at 19:10