Color row of DBGrid



I change color of the 'current' record in a DBGrid using the
OnDrawColumnCell eventi with the following code:

if (gdFocused in State) or (gdSelected in State) then
begin
if BtnMod.Down then
MyDBGrid.Canvas.Brush.Color := clYellow
else
MyDBGrid.Options := DelegheDBGrid.Options + [dgRowSelect];
MyDBGrid.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;

The problem I have is that it doesn't work exactly as I wanted. The first
time I show the DBGrid no record are hilighted though dgRowSelect is true.
Clicking on the BtnMod the focused row is correctly painted in yellow, since
dgRowSelect is true. But I need dgRowSelect to be false to edit the record
and if it is set to false, the cells are not painted in yellow.

Thanks in advance for any suggestions.


.