Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomTreeList.OnDeletion Event

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

#Declaration

Delphi
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