DBGrid如何使选中的整行变颜色(同时可以编辑),原来的属性dgrowselect变成true后就不能直接对他进行编辑了   
  想请教哪位大虾指点一二   
  谢谢 

解决方案 »

  1.   

    LZ,你的结帖率是0,本来是不应该给你任何回复的,希望你按规矩办事!!!http://delphi.about.com/od/usedbvcl/l/aa011004a.htm
      

  2.   


    procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;Field: TField; State: TGridDrawState);
    begin
    if Table1.RecNo mod 2 =0 then
    DBGrid1.Canvas.Brush.Color:=ColorGrid1.ForeGroundColorDBGrid1.Canvas.Brush.Color:=ColorGrid1.BackGroundColor;
    DBGrid1.Canvas.FillRect(Rect);
    DBGrid1.Canvas.TextOut(Rect.left+2,Rect.top+2,Field.AsString);
    end;