Este código es el que tengo puesto en el evento OnDrawColumCell del DBGrid.
Ahora te paso una imagen para que te hagas una idea
Código Delphi
[-]
procedure TFmAlbCli.DBGDatosDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
DBGDatos.Columns[0].Font.Color := clBlue;
with (Sender as TDBGrid) do
begin
if DMGestion.TDetAlb.RecNo mod 2 = 0 then
begin
Canvas.Brush.Color := clYellow;
if DBCPOnline.Checked = True then
begin
Columns[5].Font.Size := 6;
Columns[6].Font.Size := 6;
end
else
begin
Columns[5].Font.Size := 8;
Columns[6].Font.Size := 8;
end
end
else
begin
Canvas.Brush.Color := clWhite;
if DBCPOnline.Checked = True then
begin
Columns[5].Font.Size := 6;
Columns[6].Font.Size := 6;
end
else
begin
Columns[5].Font.Size := 8;
Columns[6].Font.Size := 8;
end
end;
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
if (gdSelected in State) then
begin
DBGDatos.Canvas.Brush.Color := clBlue;
DBGDatos.Canvas.Font.Style := [fsBold];
DBGDatos.Canvas.Font.Color := clWhite;
DBGDatos.DefaultDrawColumnCell(Rect, Datacol, Column, State);
end;
end;