Topic: TableGrid Field Conditional Coloured Text

Hello,
my project is used for logging service work. On entering a new job, the current date is automatically entered into the "Booked" date field. This booked-in date is one of the columns displayed on the table grid. To assist the user to notice jobs that may not have been attended to as quickly as desirable, I would like to assign a colour to the text in the date column (1 day old = green, 2 days old = yellow, 4 days old = orange, >=5 days old = red). Is there an example of how to do this so the date column is colour coded on showing the form.
Thanks for any help in advance,
David

2 (edited by derek 2018-07-18 09:29:10)

Re: TableGrid Field Conditional Coloured Text

Hi David,
How's things in your corner of the world?
Have a look at the attached as a way of colour coding according to elapsed days (I've only done it for 3 days worth but you'll get the general idea).
If it's the actual text you want colouring rather than the cell background, simply replace .color with .textcolor in the script.
Hope this helps,
Regards,
Derek.

Post's attachments

Attachment icon radsoft conditional cell colouring.zip 339.75 kb, 365 downloads since 2018-07-18 

Re: TableGrid Field Conditional Coloured Text

Hi there Derek buddy,
all good here thank you. Hope you are well. Thank you for the very good example, I will use your method in my project. Just a btw, I am unable to log on to the forum from some computers. I click the button to log on and it just sits there with no progress.
Thanks again Derek for your skill.
Regards,
David

Re: TableGrid Field Conditional Coloured Text

You're welcome.
Just a thought, but if you want to colour code the text rather than the background, you might want to switch bold on as well, otherwise it can look a bit washed-out!
If you do, add to the script  -  form1.tablegrid1.cell[1,vi].fontstyle := fsbold;
Regards,
Derek.

Re: TableGrid Field Conditional Coloured Text

Thanks Derek, really appreciate your help. As your day starts, mine is just finishing.
Regards,
David