Subject Re: [IBO] Re: tib_Grid cell colors
Author Luiz
With IBO4, if I remember now, ARow and/or BufferRowNum can assume negative
values. In IBO3, these values were always positive. You need modify your
code to work properly with negative values in ARow and/or BufferRowNum.



----- Original Message -----
From: "stanw1950" <stanw@...>
To: <>
Sent: Tuesday, May 28, 2002 12:21 PM
Subject: [IBO] Re: tib_Grid cell colors

> 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;
> end;
> end;
> end;
> end;