Subject Re: [IBO] How to change Color of selected (=highlited) row ?
Author Geoff Worboys
> I did so, and I see no differences between my code and the Contact
sample.
>
> MY Contact sample:
> ---snip---
> BufferRowNum := grContact.DataRow[ ARow ];

Hmmmm, I didn't notice this before. I guess it must be OK. I've
always been extremely wary of altering BufferRowNum inside grid
events - since IB_Grid uses BufferRowNum internally. Besides which
you had snipped this from the code you posted, so it was not obvious
you were doing this. Anyway back to your code...

if BufferRowNum > 0 then begin
// <<< Moved this line inside BufferRowNum check >>>
iOtherPilot := BufferFieldByName('OTHERPILOT').AsInteger;
// <<< Not sure what tsAbgang is or why TabIndex is relevant >>>
if tsAbgang.TabIndex = 2 then
begin
if iOtherPilot > 0 then
begin
// <<< this should be... >>>
if gdSelected in AState then


The most likely cause of your problem is the last item where you were
checking:
AState = [gdSelected]
Since AState is a set with possibly several values you need to use the
alternative syntax shown.

Hope this is more help than I was in the last attempt :-)

Geoff Worboys
Telesis Computing