Example 6: Logging a bad graphic cell

Uses OnGraphicError to report a picture field whose bytes cannot be decoded, which otherwise only shows as a cell with the field’s text instead of the picture.

Scenario

The Photo column shows the products’ pictures. A damaged picture, or one in a format the platform cannot decode, is written to the application’s log with the product it belongs to.

Units

Besides EgFireGrid: System.SysUtils (Format, FormatDateTime, Now).

The handler

procedure TForm1.Grid1GraphicError(Sender: TObject; Column: TEgFireGridColumn; const Msg: string);
begin
  LogMemo.Lines.Add(Format('%s: picture of column %s not shown (%s)',
    [FormatDateTime('hh:nn:ss', Now), Column.Title.Caption, Msg]));
end;

Why it works this way

See Also

(C) 2026 Easygate, Lda