请教:
第三行,第二格 ,是不是这样表示:
DBGridEh1[2,1] ?
可是
if   DBGridEh1[0,1].Checkboxes=true  then
          begin
          showmessage('oooooo');
          end;
提示的错误是:
uild
  [Error] Unit1.pas(44): Incompatible types: 'String' and 'Integer'
  [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

解决方案 »

  1.   

    StringGrid的第三行第儿列是
    StringGrid1.Cells[2,3]:='asdfasd'
    DBGridEh就不知道了
      

  2.   

    wwdbgrid1.cells[2, 3]:='test'
    是这样的。
      

  3.   

    DBGridEh1[0,1].Checkboxes=true  ?
    是不是应该写成
    DBGridEh1[0,1].Checkboxes.enabled
      

  4.   

    晕倒,应该是DBGridEh1[0,1].Checkboxes.checked
      

  5.   

    非常感谢各位大哥,
    还是有问题啊?
    问题1:是不是 DBGridEh1 没有cell 属性啊? 要是没有的话,那么怎么表示 控制到 cell 呢?问题2:应该是DBGridEh1[0,1].Checkboxes.checked  还是不行啊?提示的错误是:
    uild
      [Error] Unit1.pas(44): Incompatible types: 'String' and 'Integer'
      [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
      

  6.   

    应该是DBGridEh1[0,1].Checkboxes.checked  为什么不行呢?
    是不是  DBGridEh1 还要设置什么属性?谢谢!
      

  7.   

    为什么:
     DBGridEh1[1,1]:='kkkkk';
    会提示:
    Build
      [Error] Unit1.pas(111): Incompatible types: 'String' and 'Integer'
      [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'呢?是不是 DBGridEh1 有什么属性没有设置好啊?谢谢!  
      

  8.   

    DBgrid控件是用来显示数据库中的数据的,怎么能改啊?
      

  9.   

    表:
    judge bit //设置bit 所以显示时,judge 字段显示为 checkbox 如附件
    sno int
    name int judge 字段为 bit //当通过 dbgrideh 显示、出来 ,就显示为 checkbox
    CREATE procedure proc3as
    select judge,sno,name
    from test2GO
    CREATE procedure procwww
    @sno intas
    update test2
    set xx='1'
    where sno=@snoGO
    create procedure procwwv
    @sno intas
    update test2
    set xx='0'
    where sno=@snoGO
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ADOStoredProc2.Close;
    ADOStoredProc2.ProcedureName:='PROC3';
    ADOStoredProc2.Open;
    DBGridEh1.Columns[0].Title.caption:='是否选择';
    DBGridEh1.Columns[1].Title.caption:='学号';
    DBGridEh1.Columns[2].Title.caption:='姓名';
    end;
    procedure TForm1.DBGridEh1CellClick(Column: TColumnEh);
    begin
     DBGridEh1.Col:=DBGridEh1.DataSource.DataSet.RecNo;
    if     DBGridEh1.FieldColumns['xx'].Checkboxes  then 
    beginADOStoredProc1.Close;
    ADOStoredProc1.ProcedureName:='procwww';
    ADOStoredProc1.Parameters.Clear;
    ADOStoredProc1.Parameters.CreateParameter('@sno',ftinteger,pdinput,4,strtoint(ADOStoredProc2.Fieldbyname('sno').AsString));
    ADOStoredProc1.ExecProc;end;
    if     DBGridEh1.FieldColumns['xx'].Checkboxes=fakse  then
    beginADOStoredProc1.Close;
    ADOStoredProc1.ProcedureName:='procwwv';
    ADOStoredProc1.Parameters.Clear;
    ADOStoredProc1.Parameters.CreateParameter('@sno',ftinteger,pdinput,4,strtoint(ADOStoredProc2.Fieldbyname('sno').AsString));
    ADOStoredProc1.ExecProc;
    end;
    end;可是我单击最后一条记录时,就会出现如下的错误。row cannot be located for updating,some values may have been changed since it
     was  last read   请 各位大哥再给我调式一下!礼致