views:

286

answers:

2

Hi,
I just discovered this component and started working with it.

I understand that the whole concept of it is to initialize nodes on the go as they are needed but I need all of them to initialize instantly.

What is the smart way to do it?

The only thing I came up with is to use GetLast() after adding nodes.
I believe, there is a better way, or not?

+2  A: 

You can write your own procedure to build treeview manually.

Example:

procedure TForm1.BuildTree;
var
  i: integer;
  Data: ^TYourRecord;
  pNode, cNode: PVirtualNode;
begin
  for i:=0 to 1000 - 1 do
  begin
    //build parent node
    pNode := VT.AddChild(nil);
    Data := VT.GetNodeData(pNode);
    //fill record values
    Data.SomeVar := 'Parent Node';
    //build child node
    cNode := VT.AddChild(pNode);
    Data := VT.GetNodeData(cNode);
    Data.SomeVar := 'Child Node';
  end;
end;
Linas
+2  A: 

treeview.FullExpand;

atika