Hello popcornInicusor
You could adapt thoses siippets to your projets.
procedure Form1_TableGrid1_OnChange (Sender: string);
var i,c: integer;
begin
c := Form1.TableGrid1.RowCount - 1;
for i := 0 to c do
begin
if Form1.TableGrid1.Cells[3,i] = 'Yes' then Form1.TableGrid1.Cell[3,i].Color := clRed;
if Form1.TableGrid1.Cells[3,i] = 'No' then Form1.TableGrid1.Cell[3,i].Color := clGreen;
end;
end;
Same ways with dates (< Date and Date + 1) :
procedure Form1_TableGrid1_OnChange (Sender: TObject);
var
i,c: integer;
begin
Form1.TableGrid1.BeginUpdate;
c := Form1.TableGrid1.RowCount - 1;
for i := 0 to c do
begin
if StrToDateTime(Form1.TableGrid1.Cells[4,i]) < Date then Form1.TableGrid1.Cell[4,i].Color := $00FF80FF;
if StrToDateTime(Form1.TableGrid1.Cells[4,i]) = Date+1 then Form1.TableGrid1.Cell[4,i].Color := clGreen;
end;
Form1.TableGrid1.EndUpdate;
end;
JB