建议不要使用自带的编辑功能。自己去获得控件,根据控件的参数去操作数据库;或者使用DataKeyNames来获得参数
下面是根据控件来,比如你前面有一个单选按钮。
///
/// 删除Rediobutton所选中的项
///
///
///
protected void btndel_Click(object sender, EventArgs e)
{
for (int i = 0; i < grdEmpinfo.Rows.Count; i++)
{
RadioButton redio = (RadioButton)grdEmpinfo.Rows[i].FindControl("rdbCloose");
HiddenField hdfEmpid = (HiddenField)grdEmpinfo.Rows[i].FindControl("hdfEmpid");
if (redio.Checked == true)
{
int id = Convert.ToInt32(hdfEmpid.Value);
Hope.Model.E_emp_info empinfomodel = new Hope.Model.E_emp_info();
Hope.BLL.E_emp_info empinfobll = new Hope.BLL.E_emp_info();
empinfomodel = empinfobll.GetModel(id);
if (empinfomodel.del_sign == "1")
empinfobll.setdel(id, "0");
}
}
grdempinfoBind();
}