private void btnDelPerson_Click(object sender, EventArgs e) { var countRow = dataGridViewPersons.SelectedRows.Count; if (countRow > 0) { //var persons = new List<Person>(); var ids = new List <int>(); foreach (DataGridViewRow row in dataGridViewPersons.SelectedRows) { ids.Add(row.Index); } PartyPersons.RemoveRange(ids.Min(), ids.Count); //PartyPersons.OrderBy(p => p.Name).ToList(); //if (PartyPersons.Count > 0) //{ // foreach (var person in PartyPersons) // { // person.IsResponsible = false; // } // var partyPerson = PartyPersons[0]; //.IsResponsible; // if (partyPerson != null) // { // if (partyPerson.Party_PartyId != 0) // { // if (_editDGVPersons != null) // _editDGVPersons.Add(e.RowIndex); // SetButtonEnabled(false); // _isEdit = true; // } // } //} bindingSourcePersons.DataSource = PartyPersons; bindingSourcePersons.ResetBindings(true); SetStateForChange(); } }