private void button_DeletePerson_Click(object sender, EventArgs e) { if (dgp_DB.SelectedRows.Count != 0) { for (int i = 0; i < dgp_DB.Rows.Count; i++) { if (dgp_DB.Rows[i].Selected == true) { FilePersonKeywordClient client = new FilePersonKeywordClient(); client.DeletePerson(Convert.ToInt32(dgp_DB[0, i].Value)); client.Close(); Console.WriteLine(Convert.ToInt32(dgp_DB[0, i].Value)); } } RefreshDgp_DB(); RefreshDgp_file(); } }