santhosha
santhosha

Reputation: 377

how to delete a row without refreshing using rowcommand event

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);


        }

    } 


}

with this code am not getting directly row deleting.what's wrong in this,can anybody help me

Upvotes: 1

Views: 436

Answers (1)

Sambasiva
Sambasiva

Reputation: 1044

I Think,you are not adding gvaddproduct_RowDeleting() event...please check the code once again

Upvotes: 1

Related Questions