dbgrid1.options:=dbgrid1.options+[dgRowSelect];

解决方案 »

  1.   

    procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
      Field: TField; State: TGridDrawState);
    begin
      if State in [gdFocused]
        then
        begin
         //
        end;
    end;
    关键在于要处理DrawDataCell事件,用OwnerDraw来画
      

  2.   

    DBGrid1->options->dgRowSelect->true
      

  3.   

    procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
      Field: TField; State: TGridDrawState);
    begin
      if State in [gdFocused]
        then
        begin
         //
        end;
    end;
    关键在于要处理DrawDataCell事件,用OwnerDraw来画
      

  4.   

    luoweicaisd(笑三少) 说的很正确,我是过了