Subject [IBO] Re: tib_Grid cell colors
Author stanw1950
I have just tried my "fix" at work and it failed. It appears to me
that the "BufferRowNum := grHot.DataRow[ARow]" in the code (copied
from the contact sample) is the problem line. If I am not at the
first record in the grid, then BufferRowNum will not be at 1, and the
code to color the cells will be skipped for all records below the
current BufferRowNum. If I change that line to "BufferRowNum := 1",
then the coloring takes place for all rows in the grid. It seems to
work in the contact sample no matter what record is current, so I
must be missing something.

with HotQ do begin

BufferRowNum := grHot.DataRow[ARow];

if ((BufferRowNum > 0) and (ARow >= grHot.FixedRows)) then begin
tmpFld := grHot.GridFields[grHot.DataCol[ACol]];
if ((Assigned(tmpFld)) and (AFont.Color <> clHighlightText))
then begin
if tmpFld.FieldName = 'ITEMID' then
AFont.Color := clRed
end else if tmpFld.FieldName = 'PULLIN' then begin
AColor := clGreen;
AFont.Color := clWhite;