Boju (fonta i pozadine) selektovanog reda u gridu sam promenio. Medjutim, kada grid izgubi fokus selektovani red (iako je dgAllwaysShowSelection false) i dalje ostaje u bojama koje sam izabrao, tj. kao da je selektovan ?!
Probao sam da u event OnExit stavim DBGrid1.Refresh, ali mi nije pomoglo...
Inače, koristim Delphi 7.
Kod za promenu boje selektovanog reda:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if gdSelected in State then
begin
DBGrid1.Canvas.Brush.Color:=clMaroon;
DBGrid1.Canvas.Font.Color:=clLime;
end
else
begin
DBGrid1.Canvas.Brush.Color:=clWhite;
DBGrid1.Canvas.Font.Color:=clBlack;
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;