Flash in one of the cell in TDBAdvgrid.

Dear all,

I have some data on the DBAdvGrid which has a column include the expiry date and I would like to flash the cell if the expiry date almost reach within 3 months. This can provide the eye catching for operator to follow the specific record/case. Any component can be do this with DbAdvGrid.

Thanks.

You would need to do this at application level by for example using a TTimer to switch between two colors via grid.Colors[col,row]: TColor

It seems does not work. I am not use timer to do this in this moment.

Please provide details. What exactly does not work?
Is this event triggered? Is this code executed to set the red & cream color? How do you expect it to work to flash?

The TAdvDBgrid extract/show the data from the datasource and it depends on each record, check the field value (date type). if the value < today then it will flash on screen so it means that it may have several records will be flash on the screen.

In the demo under Demo\DBAdvGrid\ADOSelColor you can see how data dependent cell coloring is done.

I need to depend on the value from dataset of each record not based on which column. This is the question that I concern. Also, if the flag of the With_efftective_date is true, the column of that record will be allow to input the date, otherwise that column of the specific row will be disable and not allow user to input date.

From this event, you should depend on the value in grid.Cells[col,row].
You cannot rely on the dataset value as the active record in the dataset is not necessarily the record from the row for which OnGetCellColor is triggered. If you do not have this particular dataset value in the grid, add it to a hidden column and use this value from the hidden column.

so in which event is the best in TAdvDBGrid for this value check?

OnGetCellColor and see demo Demo\DBAdvGrid\ADOSelColor