protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { TextBox txt_name = GridView1.Rows[e.RowIndex].FindControl("txt_name") as TextBox; TextBox txt_price_tb = GridView1.Rows[e.RowIndex].FindControl("txt_price_tb") as TextBox; TextBox txt_price_mgj = GridView1.Rows[e.RowIndex].FindControl("txt_price_mgj") as TextBox; TextBox txt_remark = GridView1.Rows[e.RowIndex].FindControl("txt_remark") as TextBox; TextBox txt_url_yuan = GridView1.Rows[e.RowIndex].FindControl("txt_url_yuan") as TextBox; int id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values["gid"]); goods g = BLL.goodsManager.SearchBygid(id); g.gname = txt_name.Text.Trim(); g.gprice1 = txt_price_tb.Text.Trim(); g.gprice2 = txt_price_mgj.Text.Trim(); g.gremark1 = txt_remark.Text.Trim(); g.gurl_yuan = txt_url_yuan.Text.Trim(); if (BLL.goodsManager.Update(g) != 1) { AJAXManager.Alert(this.UpdatePanel1, "修改失败"); } if (AJAXManager.GridView_ondblclick_Cancel(this.UpdatePanel1)) { GridView1.EditIndex = -1; bind(); } }
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { if (AJAXManager.GridView_ondblclick_Cancel(this.UpdatePanel1)) { GridView1.EditIndex = -1; bind(); } }