Issues concerning finding Nodes in TTMSFMXTreeView

Hello,


I am currently in the process of trying to replace a TTreeview with the TTMSFMXTreeView in an application.
The existing and immutable database structure presents me with a certain limitations, for which im looking for a solution.

Basically I've got a database entry containing information A, B, C, D, E, from which I have to create a node with Text E, which is a subnode of a node with the Text D, which is a subnode of a node with Text C, and so on, without creating duplicates.

So for every database entry I have to check whether the respective parent nodes exist, if not create them, and if they do assign my node to the right parent.

To accomplish this I have looked at the TTMSFMXTreeView-methods "FindNodeByTextAndColumn" and "FindNodeByDBKey".
The issues are that the method "FindNodeByTextAndColumn" throws a segmentation fault immediately, even though the Treeview is still empty.
Because of this I tried to abuse the DBKey-Property when creating nodes and tried to work with the "FindNodeByDBKey", however the DBKey-Property seems to get resetted at some point which leads to the method finding nothing.

I would be very thankful if you could provide me with some advice of how to handle this matter and how I might be using those methods in a wrong way.

Are you using the latest version of TTMSFMXTreeView?
I have retested this and I could not reproduce a, issue with FindNodeByTextAndColumn.

Was retested on a default TTMSFMXTreeview. With default data, it returns correctly for example:


procedure TForm1.Button1Click(Sender: TObject);
var
  node: TTMSFMXTreeviewNode;
begin
  node := TMSFMXTreeView1.FindNodeByTextAndColumn('S5',0,false);
  if Assigned(node) then
  begin
    listbox1.Items.Add(node.Text[0]);
  end;
end;

Also, when I first clear the treeview, 

procedure TForm1.FormCreate(Sender: TObject);
begin
   TMSFMXTreeView1.Nodes.Clear;
end;

there is no segment fault when calling FindNodeByTextAndColumn

I have found my error and it had nothing to do with the methods themselves, but with my construction.


I am using of course a beginUpdate -> endUpdate construction, in which the whole treeview is constructed.
The problem seems to be, that before EndUpdate is invoked, the nodes, which were added after BeginUpdate, cannot be found be either method.

Trying it out after having removed the BeginUpdate/EndUpdate-construction, it works as intended.