Description: Calculates the background color of each visible DBGrid cell.
Execution: The formula can run many times while the grid is rendered or repainted, so it should avoid expensive or state-changing operations. A DBGrid-component formula takes precedence over the corresponding object-level cell-color formula.
Arguments:
Argument_Col: zero-based column index.
Argument_Row: zero-based row index.
Argument_EntryName: entry assigned to the column.
Argument_CellValue: raw cell value.
Argument_DisplayValue: displayed value. Desktop supplies the formatted grid text; web supplies the raw value converted to text.
Argument_CurColor: current background color before this formula runs, as a Delphi TColor value.
Argument_ReadOnly: whether the current cell is read-only.
Additional normal-row variables: Argument_DataID and the values of the other row entries under their entry names are available on both platforms, although they are not declared for this formula in the editor.
Desktop footer cells: The formula also runs for footer cells. In this case Argument_Row is Null, and neither Argument_DataID nor the row entry variables are assigned.
Result: Return a Delphi TColor-compatible integer to replace the background color. A Null result or a value that cannot be used as a color leaves the current color unchanged.
Availability: DBForm DBGrid component on desktop and web.
Example:
Result := Argument_CurColor;
if Argument_CellValue = "Late" then
Result := 255; // red TColor value