Vean lo que se me ocurrió, aunque aún no funciona, creo que estoy bastante cerca, asi que cualquier ayuda o sugerencia es bien recibida.
Lo que hice fue que dentro del procedimiento OnDrawCell ingrese una variable boolean y puse una condicion, en la cual, si la variable es true, entonces debe cambiar el estilo por negrita.
Busque la variable PINTAR en el codigo:
Código Delphi
[-]
procedure TFDistri.GrDetalleDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
sTexto: String; Alineacion: TAlignment; iAnchoTexto: Integer; begin
with GrDetalle.Canvas do
begin
Font.Name := GrDetalle.Font.Name;
Font.Size := GrDetalle.Font.Size;
if ARow = 0 then
Alineacion := taCenter
else
if ACol = 4 then
Alineacion := taRightJustify
else
Alineacion := taLeftJustify;
if gdFixed in State then
begin
Brush.Color := clNavy; Font.Color := clWhite; Font.Style := [fsBold]; end
else
if pintar then
begin
Font.Style := [fsBold]; end;
sTexto := GrDetalle.Cells[ACol,ARow];
FillRect( Rect );
iAnchoTexto := TextWidth( sTexto );
case Alineacion of
taLeftJustify: TextOut( Rect.Left + 5, Rect.Top + 2, sTexto );
taCenter: TextOut( Rect.Left + ( ( Rect.Right - Rect.Left ) - iAnchoTexto ) div 2, Rect.Top + 2, sTexto );
taRightJustify: TextOut( Rect.Right - iAnchoTexto - 2, Rect.Top + 2, sTexto );
end;
end;
end;
Luego lo que hice donde mando escribir el valor en la celda, puse la variable variable pintar = true, escribo el valor y luego pongo pintar = false.
Código Delphi
[-]
pintar := true;
GrDetalle.Cells[col+2,memfila] := IntToStr(Suma);
pintar := false;
Pero el problema es que algo no estoy haciendo bien, porque siempre llega la variable PINTAR en false. y si quito la parte donde dice pintar = false, me pone todos las celdas en negrita.
Gracias por la ayuda...