/// <summary> /// to Edit And Delete Command /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdLandInfoRespondents_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditRow") { ViewState["LND_HOLDINGID"] = e.CommandArgument; getLandInfoRespondant(); btn_SaveRes.Text = "Update"; btn_ClearRes.Text = "Cancel"; //SetUpdateMode(true); BindGrid(true, true); } else if (e.CommandName == "DeleteRow") { int landholdID = Convert.ToInt32(e.CommandArgument); LandInfoRespondentsBLL objLIRBLL = new LandInfoRespondentsBLL(); objLIRBLL.DeleteLandInfoRespondents(landholdID); BindGrid(false, true); ClearLandHolding(); btn_SaveRes.Text = "Save"; btn_ClearRes.Text = "Clear"; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('Data deleted successfully');", true); } }