Subject RE: [IBO] problem with TIB_Grid.GetCellProperties
Author Jason Wharton
Wolfgang wrote:
> with the following code, when I move up or down in the grid, the
> field getting focus is painted in the color of the row that had
> focus before.
>
> How can I access the fields of the new row ARow which gets focus?
>
> procedure TfrmVPro.DgrGetCellProps(Sender: TObject; ACol,
> ARow: Integer;
> AState: TGridDrawState; var AColor: TColor; AFont: TFont);
> begin
> inherited;
> if ARow=0 then Exit;
> if not DSet.Prepared then Exit;
> if DSet.BufferFieldByName('OK').Value='F' then
> AColor := clRed;
> end;

You have to set the BufferRowNum prior to accessing the Value of one of its
columns.

See the Contact sample application in the {IBO}\Samples\Contact folder for
an example of how to do this.

Jason Wharton