procedure TNewPurPlanFrm.SGpoSelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
var
  SgCanEdit: TGridOptions;
begin
   SGCanEdit:=SGPo.Options;
    if ACol in [0..3,6] then
    {0,1,2,3,6列不能修改}
      Exclude(SGCanEdit,goediting)
    else
      Include(SGCanEdit,goediting);
  SGPo.Options:=SGCanEdit;
end;

解决方案 »

  1.   

    在selectcell事件中加入一下代码:
    if acol=1 then
    Exit;
    这样就会使只读状态。上句代码表示,如果让第一列设为只读状态。
      

  2.   

    StringGrid1.FixedCols := i;
    //i就是你想要设成只读的几列
    ===================================================================
     暗恋女司机,薪水全做公交车了! 
    http://www.csdn.net/expert/topic/926/926315.xml?temp=4.807681E-02
      

  3.   

    procedure Tform1.Stringgrid1SelectCell(Sender: TObject; ACol,
      ARow: Integer; var CanSelect: Boolean);
    var
    begin
       if ACol in [0..3,6] then
            canselect:=false;
    end;