回复 8楼gw0506的帖子
有e.NewValues,但是我取不到新值,试了很多次了,我从开始点击编辑,到修改后点击更新的代码是这样的,你帮我看看是不是哪里写错了
//更新开始
protected void C1GridView1_RowEditing(object sender, C1.Web.Wijmo.Controls.C1GridView.C1GridViewEditEventArgs e)
{
//int RowIndex = e.NewEditIndex;
C1GridView1.EditIndex = e.NewEditIndex;
//int id = Convert.ToInt32(C1GridView1.DataKeys[C1GridView1.EditIndex].Value.ToString());
//bllSchool.Delete(id);
BindGrid();
}
//更新行数据
protected void C1GridView1_RowUpdating(object sender, C1.Web.Wijmo.Controls.C1GridView.C1GridViewUpdateEventArgs e)
{
C1GridView1.EditIndex = -1;
BindGrid();
}
protected void C1GridView1_RowUpdated(object sender, C1.Web.Wijmo.Controls.C1GridView.C1GridViewUpdatedEventArgs e)
{
//int RowIndex = e.RowIndex;
//int id = Convert.ToInt32(C1GridView1.DataKeys[RowIndex].Value.ToString());
//C1GridView1.Rows[e.NewValues[1].ToString();
FT.KMS.Model.School modelSchool = new FT.KMS.Model.School();
modelSchool.SchoolName = e.NewValues.Values.ToString();
modelSchool.Address = e.NewValues[1].ToString();
modelSchool.Phone = C1GridView1.Rows[e.AffectedRows].Cells[3].Text;
modelSchool.SetupPerson = C1GridView1.Rows[e.AffectedRows].Cells[4].Text;
modelSchool.SchoolID = 59;
bllSchool.Update(modelSchool);
C1GridView1.EditIndex = -1;
BindGrid();
} |