protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string EmployeeID = this.GridView1.DataKeys[e.RowIndex][0].ToString();//Datakeys是一个数据库标题集合;[e.RowIndex]是指当前所在行
        string LastName = ((TextBox)this.GridView1.Rows[e.RowIndex].Cells[0].Controls[0]).Text.ToString();       
                  
        
        Response.Write(LastName);
    }
Controls[0]这个是什么意思越详细越好;;还是就是一般什么时候加()比方说:ToString();
                                  e.NewEditIndex;e.NewPageIndex;

解决方案 »

  1.   

    前面都有了(TextBox)显示转换。。
    是方法后面都要用到(),还有显示转换也要用到,其他的暂时想不到
      

  2.   

    Controls[0]代表Cell[0]内包含的第一个控件Control,0是索引
      

  3.   

    同意2楼是找到GridView中行号为e.RowIndex行,第1个单元格中的第一个控件,是TextBox控件,获取了里面的内容
    应该是一个表中的某一行上某一个单元格里面可以包含若干个控件,才这样写的