有什么办法让DBGrid的一列不能编辑

解决方案 »

  1.   

    好像不对
    fixedcols:
    Specifies the number of columns on the left of the grid that cannot be scrolled.
    不能指定某列,听大家怎么说
      

  2.   

    i为你指定的某列
    DBGrid1.Columns.Items[i].ReadOnly := true;
      

  3.   

    procedure TMainForm.DBGrid1ColEnter(Sender: TObject);
    begin
      if dbgrid1.SelectedField=adoquery1.FieldByName('app_id') then
        dbgrid1.options:=dbgrid1.options-[dgediting]
      else
        dbgrid1.options:=dbgrid1.options+[dgediting];
    end;
      

  4.   

    双击DBGrid,弹出一个对话框,单击上面的一个按钮,加上所有字段,点中一个字段,然后在属性编辑器里设置Readonly属性为True