unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, ImgList;

type
  TForm1 = class(TForm)
    ImageList1: TImageList;
    DrawGrid1: TDrawGrid;
    procedure DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{$J+}
procedure TForm1.DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
const
   index1: integer=0;
begin
  //komórki wypełniane wierszami po kolei
  index1 := ARow * Drawgrid1.Colcount + ACol;
  if (ACol=1)and(ARow=1) then //napis w komórce o współrzędnych 1,1
     Drawgrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,'Ala')
    else
    begin
     ImageList1.Draw(Drawgrid1.Canvas,Rect.Left,Rect.Top,index1);
     inc(index1);
    end;
end;

end.
