Skip to main content

TcxCustomTreeList.OnDeletion Event

Enables you to perform specific actions when a node is being deleted.

Declaration

property OnDeletion: TcxTreeListNodeChangedEvent read; write;

Remarks

Sender specifies the tree list.

ANode specifies the node being deleted.

The tree list allows you to specify additional data for each node (using the node’s Data property). If this data is specified, it must be released manually before a node is deleted. For this purpose, handle the OnDeletion event.

The following example shows how to handle the OnDeletion event to deallocate the node’s data object before the node is completely deleted.

// Delphi

// …

procedure <TForm>.<cxTreeList>Deletion(Sender: TcxCustomTreeList; ANode: TcxTreeListNode);

var

P: Pointer;

begin

P := ANode.Data;
  if P <> nil then
    Dispose(P);
end;
See Also