Drawing from imagelist on TAdvTreeView

I am trying to draw images from a TImagelist on rows in a TAdvTreeView, following the guideline in the manual in the sector Customization:


procedure TForm1.AdvTreeView1AfterDrawNodeText(Sender: TObject;
  ACanvas: TCanvas; ARect: TRectF; AColumn: Integer; 
  ANode: TAdvTreeViewVirtualNode; AText: string);
begin 
  if (AColumn = 1) then
  begin 
    ImageList1.Draw(ACanvas, 0, 0, 0);
  end;
end;



This should draw an image on every row, but nothing is drawn. I tried drawing on other places (e.g. a TImage canvas) and that works ok.
I also tried clearing the column first with FillRect, that works, but no image is drawn.

Should I use another Event to draw an Image in a column? Or is it just not poassible?

You should use the ARect parameter coordinates:

procedure TForm106.AdvTreeView1AfterDrawNodeText(Sender: TObject;
  ACanvas: TCanvas; ARect: TRectF; AColumn: Integer;
  ANode: TAdvTreeViewVirtualNode; AText: string);
begin
  ImageList1.Draw(ACanvas, Round(ARect.Left), Round(ARect.Top), 0);
end;

It's unclear why you want to draw images from an image list while you can have an icon for each row separately via assigning an image to the ExpandedIcon and CollapsedIcon properties of a node.

Of course....I should have thought of that myself.
Thank you!

Concerning your last remark, Pieter:
It's unclear why you want to draw images from an image list while you can have an icon for each row separately via assigning an image to the ExpandedIcon and CollapsedIcon properties of a node.
I have a column that holds several icons that show the state of something in the program. This column has 8 or 10 icons.