TMSFMXTreeView Node background color

Hi,


How can the background color of a node be set ?

When i use this code nothing happens :

procedure TForm10.TMSFMXTreeView1AfterDrawNode(Sender: TObject;
  ACanvas: TCanvas; ARect: TRectF; ANode: TTMSFMXTreeViewVirtualNode);
  begin

 if aNode.node.text[3] <> '' then
  begin
           ACanvas.Fill.Kind  := TBrushKind.Solid;
           ACanvas.Fill.Color := TAlphaColorRec.Red;
  end;

end;

Using ACanvas.Fill doesn't show anything either :

         ACanvas.Fill.Bitmap.Bitmap := Image31.Bitmap;


My goal is to check each node for values, and according it;s value, color the background.

Thanks !

Hi, 


The event happens after the node is drawn (OnAfterDrawNode). What you are looking for is the OnBeforeDrawNode or more specifically the OnGetNodeColor event.

Works great now.



Thanks alot Pieter !