To traverse the node tree you need to start with AdvTreeView1.GetFirstRootNode, as you did in your sample. If you want the next node on the same level, you call AdvTreeView1.GetNextSibling, and the parameter is the previous node. If you want to go down a level, you need to call AdvTreeView1.GetFirstChildNode. You can also directly call GetNextSibling on the node itself without parameters, which makes it easier to follow. Below is a sample that shows all nodes at three levels (ROOT level, sub level 1, sub level 2)
var
n, ns, nss: TAdvTreeViewNode;
begin
n := AdvTreeView1.GetFirstRootNode;
//level 0 (ROOT)
while Assigned(n) do
begin
OutputDebugString(pchar(n.Text[0]));
ns := n.GetFirstChild;
//level 1
while Assigned(ns) do
begin
OutputDebugString(pchar(' '+ns.Text[0]));
nss := ns.GetFirstChild;
//level 2
while Assigned(nss) do
begin
OutputDebugString(pchar(' '+nss.Text[0]));
nss := nss.GetNextSibling;
end;
ns := ns.GetNextSibling;
end;
n := n.GetNextSibling;
end;
If you mean read-only in no editing, then there is no editing available by default. If you mean also to not allow selection/interaction, but only scrolling then you can use Interaction.ReadOnly in combination with disabled selection:
procedure TForm1.AdvTreeView1BeforeSelectNode(Sender: TObject;
ANode: TAdvTreeViewVirtualNode; var ACanSelect: Boolean);
begin
ACanSelect := False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
AdvTreeView1.Interaction.ReadOnly := True;
end;