OwnerDraw in TReportListView

Problem I want to do some extra drawing in special cells of TReportListView. Is there anything like an "OwnerDraw" event?
Solution Use the event OnDrawCell to put your own drawing on top of the TReportListView cell. Following is an example code which draws a blue line across the cell in row 3 and columns 1:

procedure TForm1.RL1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);

begin
if (ACol=1) and (ARow=3) then
  begin
  RL1.Canvas.Pen.Color := clBlue;
  RL1.Canvas.MoveTo (Rect.Left, Rect.Top);
  RL1.Canvas.LineTo (Rect.Right, Rect.Bottom);
  end;
end;

 


Last Update: 2006-01-13