protected void GridView_Contacto_RowDeleting(object sender, GridViewDeleteEventArgs e) { ContactoRepositorio cr = new ContactoRepositorio(); string id = this.GridView_Buscar.DataKeys[e.RowIndex].Values[0].ToString(); if (cr.DeleteContact(int.Parse(id))) { ////this.GridView_Buscar.Rows[e.RowIndex].Visible = false; ////validar el //DataTable dt = (DataTable)ViewState["Consulta"]; //foreach (DataRow dr in dt.Rows) //{ // if (dr[0].ToString() == id) // { // dt.Rows.Remove(dr); // break; // } //} //// dt.Rows[e.RowIndex].Delete(); //ViewState["Consulta"] = dt; Search(); LoadGrid(); UpdatePanel1.Update(); DeleteImage(id); } }
protected void GridView_Contacto_RowDeleting(object sender, GridViewDeleteEventArgs e) { ContactoRepositorio cr = new ContactoRepositorio(); string id = this.GridView_Contacto.DataKeys[e.RowIndex].Values[0].ToString(); if (cr.DeleteContact(int.Parse(id))) { LoadGrid(); UpdatePanel1.Update(); DeleteImage(id); } }