AdvTreeView

Hello together,

I am trying to delete a node in the collection based mode in the OnBeforeUpdateNode Event. But in this event there is only a virtual node value called ANode:


procedure TForm1.AdvTreeViewGroupsBeforeUpdateNode(Sender: TObject;
  ANode: TAdvTreeViewVirtualNode; AColumn: Integer; var AText: string;
  var ACanUpdate: Boolean);



I tried to use the RemoveVirtualNode-Method, but the Nodes.Count didn't decrease.


Thanks
Martin

Hi, 


You can access the collection item by using the following code:

procedure TForm1.AdvTreeView1BeforeUpdateNode(Sender: TObject;
  ANode: TAdvTreeViewVirtualNode; AColumn: Integer; var AText: string;
  var ACanUpdate: Boolean);
begin
  AdvTreeView1.RemoveNode(ANode.Node);
end;

Kind Regards, 
Pieter