Skip to main content

TdxTreeViewGetImageIndexEvent Type

The image index retrieval procedural type for tree nodes.

Declaration

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