how can I save and restore the current selected "itemIndex" of a TTMSFMXDirectoryTreeView?

Hi. Ive tested some parts, but I cannot get the "current index", etc. of an TTMSFMXDirectoryTreeView-Entry. And how can I select an item of my own directly on startup? (or can I set a "directory-entry")

Ive tested:
memQuestion.Lines.Add('TTMSFMXTreeViewNode(tmstv.SelectedNode).Index = ' + TTMSFMXTreeViewNode(tmstv.SelectedNode).Index.ToString);
memQuestion.Lines.Add('tmstv.SelectedNodeCount ' + tmstv.SelectedNodeCount.ToString);
memQuestion.Lines.Add('tmstv.Index ' + tmstv.Index.ToString);
memQuestion.Lines.Add('tmstv.Nodes.Count ' + tmstv.Nodes.Count.ToString);
memQuestion.Lines.Add('tmstv.GetTotalVirtualNodeCount ' + tmstv.GetTotalVirtualNodeCount.ToString);

but nothing I can use for that.

BTW: my problem with "selected items will not show" - the problem is: "Adapted to Style" or not ;-)

Tks..

Current Index does not exist in TTMSFMXDirectoryTreeView because the treeview can have sub-nodes which all have their own Index. To store a unique index you can use the Row property and restore it by using GetNodeForRow.

var
  r: Integer;
begin
  r := TMSFNCTreeView1.SelectedNode.VirtualNode.Row;
  TMSFNCTreeView1.SelectNode(TMSFNCTreeView1.GetNodeForRow(r).Node);
end;

oh no, your example is for FNC :( Ive written the task in FMX ;-)

have you an idea? (or can I use that for FMX too?

Oops, should be the same:

var
  r: Integer;
begin
  r := TMSFMXTreeView1.SelectedNode.VirtualNode.Row;
  TMSFMXTreeView1.SelectNode(TMSFMXTreeView1.GetNodeForRow(r).Node);
end;