Topic: Color cell from 2 conditions
In my database I have recorded the measurements, in centimeters, of the waist circumferences of both men and women. I need a procedure that makes the tablegrid's waist circumference cell turn yellow when men's is greater than 102cm and women's is greater than 88cm.
I tried this code but without success:
procedure frmStart_TableGrid1_OnChange (Sender: TObject); var i,c: INTEGER; begin c := frmStart.TableGrid1.RowCount - 1; for i := 0 to c do begin IF (frmstart.TableGrid1.Cells[4,i] = 'MASCULINO') AND (StrToInt(frmStart.TableGrid1.Cells[52,i]) > 102) Then frmStart.TableGrid1.cell[52,i].Color := clYellow ELSE frmStart.TableGrid1.cell[52,i].Color := clWhite; end; End;
Is it possible to do that?