Hello, I'm trying to change the Item color dynamically, but nothing happened (DefaultItem colors). I'm trying to do that assigning the item color in function of a field value of my db table.
for i := 0 to DBPlanner1.Items.Count -1 do
begin
item := DBPlanner1.Items[i];
idcat := dtmMain.JMSUtl.RetFieldInt('SELECT CategoryID FROM tbactions WHERE ActionID = ' + item.DBKey );
if idcat = 60 then
color := clRed
else if idcat = 70 then
color := clRed
else if idcat = 80 then
color := clLime
else
color := clYellow;
item.Color := color;
item.ColorTo := color;
item.CaptionBkg := color;
item.CaptionBkgTo := color;
item.TrackColor := color;
end;
This code is recalled each time I change something in the table.
Whats wrong in this code? Is there any property that avoid this?
It seams a trivial problem.
Thank you