怎样实现使得StringGrid中的某一cell不可编辑?

解决方案 »

  1.   

    oncellselect
      if col=3 then
        option := option - [goediting]
      else
        option := option + [goediting]请大家去 http://www.new7wonders.com/c/voting.php 投长城一票
      

  2.   

    procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
      ARow: Integer; var CanSelect: Boolean);
    begin
      if (ARow=1) and (ACol=1) then
        StringGrid1.Options:=StringGrid1.Options-[goEditing]
     else
        StringGrid1.Options:=StringGrid1.Options+[goEditing];
    end;//写OnSelectCell事件
      

  3.   

    procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
      ARow: Integer; var CanSelect: Boolean);
    begin
            if (acol=2) and (arow=2) then
                canselect:=false;//不可选择
    end