private void buttonRemoveCharacter_Click(object sender, EventArgs e) { IList <int> charactersToRemove = new List <int>(); for (var i = 0; i < dataGridViewCharacters.SelectedRows.Count; i++) { var character = ((ObjectView <CharacterSourceDTO>)dataGridViewCharacters.SelectedRows[i].DataBoundItem) .Object; Form f; charactersToRemove.Add(character.Id); } LoadedAsset.RemoveCharacters(charactersToRemove); _characterSources.DataSource = LoadedAsset.GetAllCharacterSources().ToList(); _characterSources.Refresh(); _rpcForm.Close(); SetModified(); dataGridViewCharacters.ClearSelection(); }