//更新数据
Bind();
}
protected void gvwProduct_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//给单元格,添加单击事件
e.Row.Cells[6].Attributes.Add("onclick", "return confirm('您确定要删除该行数据!')");
}
}
protected void gvwProduct_RowEditing(object sender, GridViewEditEventArgs e)
{
Label specialLabel = (Label)gvwProduct.Rows[e.NewEditIndex].FindControl("Label4");
Label categoryIdLabel = (Label)gvwProduct.Rows[e.NewEditIndex].FindControl("Label5");
//进入编辑模式
gvwProduct.EditIndex = e.NewEditIndex; //(普通模式<-)分水岭(->编辑模式)
//更新数据
Bind();