--- In IBObjects@y..., manuelfresnedaguerra@y... wrote:
Use "BufferFieldByName" rather than "FieldByName".
> procedure TForm1.IB_Grid1GetCellColor(Sender: TObject; ACol, ARow:
> Integer;
> AState: TGridDrawState; var AColor: TColor);
> begin
> with IB_Grid1 do
> begin
> {Pone la celda en Amarillo si es el precio y es menor que 0}
> if ARow = Row then
> if ACol = Col then
> if (Assigned( GridFields[ DataCol[ACol]])) and
> (GridFields[ DataCol[ACol]].FieldName = 'ARTPRE') then
> if IB_Query1.FieldByName('artpre').AsFloat < 0 then
------------
I think you should use here :
if IB_Query1.BufferFieldByName('artpre').AsFloat < 0 then
...
------------
> AColor := clYellow;
>
> end;
> end;
>
>
> Thanks.