Topic: [Script] Change the color of the cell component TableGrid

Change the color of the cell component TableGrid, depending on its content.


procedure Form1_GridEmployees_OnChange (Sender: string);
var
   i,c: integer;
begin
     c := Form1.GridEmployees.RowCount - 1;
     for i := 0 to c do
     begin
         if Form1.GridEmployees.Cells[3,i] = 'Yes' then Form1.GridEmployees.Cell[3,i].Color := clRed
             else Form1.GridEmployees.Cell[3,i].Color := clGreen;
     end;
end;

begin

end.

Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.