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

TdxTreeViewGetImageIndexEvent Type

The image index retrieval procedural type for tree nodes.

#Declaration

Delphi
TdxTreeViewGetImageIndexEvent = procedure(Sender: TdxCustomTreeView; ANode: TdxTreeViewNode; var AImageIndex: Integer) of object;

#Parameters

Name Type Description
Sender TdxCustomTreeView

The Tree View control that raised an image index retrieval event.

ANode TdxTreeViewNode

The target tree node.

AImageIndex Integer

An index of the image displayed in the target tree node.

#Remarks

The following OnGetImageIndex event handler assigns images with the indexes 1 and 2 to expanded and collapsed nodes, respectively.

procedure TForm1.dxTreeViewControl1GetImageIndex(Sender: TdxCustomTreeView;
  ANode: TdxTreeViewNode; var AImageIndex: Integer);
begin
  if ANode.HasChildren then
    if ANode.Expanded then
      ANode.ImageIndex := 1
    else
      ANode.ImageIndex := 2;
end;

Note

A tree node’s ExpandedImageIndex allows you to do the same without an OnGetImageIndex event handler.

The Tree View’s OnGetImageIndex and OnGetSelectedImageIndex events reference the TdxTreeViewGetImageIndexEvent type.

See Also