private void cellClick(int row, int col) { DataGridViewRow cell = causa_grid.Rows[row]; int editar = cell.Cells["editar"].ColumnIndex; int eliminar = cell.Cells["eliminar"].ColumnIndex; string id = cell.Cells["id"].Value.ToString(); string causa = cell.Cells["causa"].Value.ToString(); if (col == editar) { modoEdit(); inCausa.Text = causa; sql_id = id; } else if (col == eliminar) { lib.del(id); } }