如何在不使用rowcommand事件刷新的情况下删除行

时间:2013-09-25 07:28:27

标签: asp.net

protected void Gvaddproduct_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandName.ToUpper() == "DELETE")
    {
        int? DeleteProductStatus;
        GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
        int index = row.RowIndex;
        objhatcheryPL.sno1 = Convert.ToInt16(Gvaddproduct.DataKeys[index].Value);
        DeleteProductStatus = objhatcheryBAL.ProductDetDelete(objhatcheryPL);
          FillProductDetails();

        if (DeleteProductStatus.Equals(1))
        {

            ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "UpdateDetails", "alert('Deleted Successful');", true);


        }

    } 


}

使用此代码我没有直接删除行。这有什么不对,有人可以帮助我吗

1 个答案:

答案 0 :(得分:1)

我想,你没有添加gvaddproduct_RowDeleting()事件......请再次查看代码

相关问题