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

TdxCustomTreeView.OnExpanded Event

In This Article

Allows you to respond to a node expansion.

#Declaration

Delphi
property OnExpanded: TdxTreeViewNodeEvent read; write;

#Remarks

This event occurs every time a tree node is expanded.

You can handle the OnExpanding event to prohibit users from expanding a node.

Note

You can handle the control’s OnCollapsing and OnCollapsed events to track node collapse operations and customize their behavior.

The following OnExpanded event handler changes an image of the expanded node whose image index is 2 to an image with the index 1:

procedure TForm1.dxTreeViewControl1Expanded(Sender: TdxCustomTreeView;
  ANode: TdxTreeViewNode);
begin
  if ANode.ImageIndex = 2 then
    ANode.ImageIndex := 1;
end;

Note

A tree node’s ExpandedImageIndex allows you to change the expanded node image without an OnExpanded event handler.

Refer to the TdxTreeViewNodeEvent type description for information on available options.

See Also