Ver Mensaje Individual
  #4  
Antiguo 09-03-2023
chenech chenech is offline
Miembro
 
Registrado: dic 2013
Posts: 72
Reputación: 11
chenech Va por buen camino
Esto lo acabo de probar en FMX con StringGrid y me funciona en StringGrid1DrawColumnCell
Sacado de aqi:
https://stackoverflow.com/questions/...grid-row-color

Código:
var
  aRowColor: TBrush;
  aNewRectF: TRectF;
begin
  aRowColor := TBrush.Create(TBrushKind.Solid, TAlphaColors.Alpha);

  if (StringGrid1.Cells[7, Row] = '1') then
    aRowColor.Color := TAlphaColors.Green
  else
    aRowColor.Color := TAlphaColors.Red;
  aNewRectF := Bounds;
  aNewRectF.Inflate(3, 3);
  Canvas.FillRect(aNewRectF, 0, 0, [], 1, aRowColor);
  Column.DefaultDrawCell(Canvas, Bounds, Row, Value, State);
  aRowColor.free;

Última edición por chenech fecha: 09-03-2023 a las 13:52:15.
Responder Con Cita