procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
var Bitmap:TBitMap;
K1,K2:TRect;
C:TColor;
begin
if Column.Index=0 then
begin
with (Sender As TDBGrid).DataSource.DataSet do
if RecordCount>0 then
begin
BitMap:=TBitMap.Create;
ImageList1.GetBitmap(0,BitMap);
K1.TopLeft:=Point(0,0);K1.BottomRight:=Point(16,16);
K2.TopLeft:=Rect.TopLeft;K2.BottomRight:=Point(Rect.Left+16,Rect.Bottom);
C:=(Sender As TDBGrid).Canvas.Brush.Color;
(Sender As TDBGrid).Canvas.Brush.Color:=clWhite;
(Sender As TDBGrid).Canvas.FillRect(Rect);
(Sender As TDBGrid).Canvas.CopyRect(k2,Bitmap.Canvas,K1);
FreeAndNil(BitMap);
K1:=Rect;
K1.Left:=Rect.Left+16;
end;
(Sender As TDBGrid).Canvas.Brush.Color:=C;
(Sender As TDBGrid).DefaultDrawColumnCell(K1,DataCol,Column,State);
end
else (Sender As TDBGrid).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;