今天我刚从2003升级到2005,在使用gridvview的时候,原来使用的删除代码不能使用了,原来使用的代码内容是用 e.Item.Cells[2].text 来获取所选择的行的数据但现在提示Item.cells[2]无效。

解决方案 »

  1.   

    e.Row.Cells[x] 同样不行,提示也是row.cells[x]无效。
      

  2.   

    而且e下面也不包含item和row的定义。
      

  3.   

    protected void GridView1_RowDataBound( object sender, GridViewRowEventArgs e )
    {
      e.Row.Cells[0].Text = "ok"; 
    }
      

  4.   

    protected void GridView1_RowDataBound( object sender, GridViewDeletedEventArgs e )
    {
      cmd.commandText="delete * from user where id="+ convert.toint32(e.item.cells[2].text)
    }
      

  5.   

    难道是使用e.keys.tostring来获取数字?
    好象不能实现吧.
      

  6.   

    难道是使用e.keys.count.tostring来获取数字?
    好象不能实现吧.