protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
bind(iQuestion);//绑定数据代码
((TextBox)(GridView1.Rows[e.NewEditIndex].Cells[1].Controls[0])).Enabled = false;//使第一列不能编辑
}protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//更新,这里的值总是不变,就是无法取到更改后的值,始终是更改前的值。
((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text
//绑定
bind(iQuestion);
}
{
GridView1.EditIndex = e.NewEditIndex;
bind(iQuestion);//绑定数据代码
((TextBox)(GridView1.Rows[e.NewEditIndex].Cells[1].Controls[0])).Enabled = false;//使第一列不能编辑
}protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//更新,这里的值总是不变,就是无法取到更改后的值,始终是更改前的值。
((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text
//绑定
bind(iQuestion);
}
{
bind(iQuestion);
}
正如 luck0235(风平浪静时人人都能掌舵) 所说,PageLoad事件中有问题。看样子我对
IsPostBack 的理解还是不对,给分结贴。