1
I created this procedure to popular a treeview:
procedure TFrmGerProfDock.Button1Click(Sender: TObject);
Var
Tables: TTreeNode;
I: Integer;
begin
  for I := 0 to ds.DataSet.FieldCount - 1 do
  begin
    TreeView1.Items.BeginUpdate;
    TreeView1.Items.Add(nil, ds.DataSet.Fields[I].FieldName); //adiciona um node novo
    while not ds.DataSet.Eof do
    begin
      TreeView1.Items.AddChild(TreeView1.Items[I],
        ds.DataSet.Fields[I].AsString);//adiciona ao node novos childs
      ds.DataSet.Next;
    end;
    ds.DataSet.First;
    TreeView1.Items.EndUpdate;
  end;
end;
The problem is that the procedure always add the Childs in the first Node, what would be wrong in this my code?
Exactly, the problem is that they all get separate nodes without a root, there’s how I create a Node and put them all in?
– Artur_Indio
Look at my DIT..
– Edgar Muniz Berlinck
Thank you very much, thank you.
– Artur_Indio