如何任意设置他的某一列为只读或可写。

解决方案 »

  1.   


     在StringGrid1SelectCell中
      if arow=3 then
       canselect:=false  //第3行不得选择或者在onkeypress中
      if stringgrid1.row=3 then
        key=#0  ////第3行可以选择但不得输入数据
      

  2.   


      //第3列可编辑, 其它列只读
        
      在StringGrid1click中  if stringgrid1.col=3 then  
        stringgrid1.options:=stringgrid1.options+[goediting,goalwayshoweditor] 
      else
        stringgrid1.options:=stringgrid1.options-[goediting,goalwayshoweditor];