为什么我的代码不能取得DataGrid(WebForm)中处于编辑状态的单元格的值。
ghbh 2004-05-12 07:56:24 在属性生成器中添加编辑按纽,点编辑按纽后在编辑框中输入新值。然后用下面的代码。
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
TextBox ControlText1,ControlText2;
ControlText1 = (TextBox)e.Item.Cells[1].Controls[0];
ControlText2 = (TextBox)e.Item.Cells[2].Controls[0];
this.Response.Write(ControlText1.Text);
}
this.Response.Write(ControlText1.Text);输出的还是原来的值,为什么?