kolorowy dbgid

0

Witam serdecznie mam drobny problem otoz pokolorowalem grida:

procedure TfmKD.dbgSCDrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  if Odd(dsSC.DataSet.RecNo)then
   (Sender as TDBGrid).Canvas.Brush.Color:= RGB(229,247,255);

  (Sender as TDBGrid).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;

Wszystko dziala az milo z tym ze gdy zaznaczam rekord ktory zostal pokolorowany to kolor pozostaje (nie zmienia sie na szare tlo) Wie ktos jak to poprawic ??

0

TGridDrawState + F1

0

Dzieki misiekd

procedure TfmKD.dbgSCDrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  if not((gdFocused in State) or (gdSelected in State)) then
    if Odd(dsSC.DataSet.RecNo) then
    (Sender as TDBGrid).Canvas.Brush.Color:= RGB(229,247,255);

  (Sender as TDBGrid).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;

1 użytkowników online, w tym zalogowanych: 0, gości: 1