The DBGrid


Here are some of the things you can do with a DBGrid:



Changing the font color in the cells:

First change the DefaultDrawing property in the Object Inspector to False.

Then add this code:

procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
                  DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
    DBGrid1.Canvas.Font.Color := clYellow;
    DBGrid1.DefaultDrawDataCell(Rect, Column.Field, State);
end;