diff --git a/LibationWinForms/Dialogs/RemoveBooksDialog.cs b/LibationWinForms/Dialogs/RemoveBooksDialog.cs index 139612c5..faa829fc 100644 --- a/LibationWinForms/Dialogs/RemoveBooksDialog.cs +++ b/LibationWinForms/Dialogs/RemoveBooksDialog.cs @@ -30,7 +30,8 @@ namespace LibationWinForms.Dialogs InitializeComponent(); _labelFormat = label1.Text; - _dataGridView.CellContentClick += (s, e) => _dataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit); + _dataGridView.CellContentClick += (_, _) => _dataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit); + _dataGridView.CellValueChanged += (_, _) => UpdateSelection(); _dataGridView.BindingContextChanged += _dataGridView_BindingContextChanged; var orderedGridEntries = _libraryBooks @@ -58,7 +59,7 @@ namespace LibationWinForms.Dialogs { var removedBooks = await LibraryCommands.FindInactiveBooks((account) => new WinformResponder(account), _libraryBooks, _accounts); - var removable = _removableGridEntries.Where(rge => removedBooks.Any(rb => rb.Book.AudibleProductId == rge.AudibleProductId)); + var removable = _removableGridEntries.Where(rge => removedBooks.Any(rb => rb.Book.AudibleProductId == rge.AudibleProductId)).ToList(); if (!removable.Any()) return; diff --git a/LibationWinForms/Form1.cs b/LibationWinForms/Form1.cs index deeebcae..1430cee3 100644 --- a/LibationWinForms/Form1.cs +++ b/LibationWinForms/Form1.cs @@ -134,7 +134,7 @@ namespace LibationWinForms // suppressed filter while init'ing UI var prev_isProcessingGridSelect = isProcessingGridSelect; isProcessingGridSelect = true; - setGrid(); + this.UIThread(() => setGrid()); isProcessingGridSelect = prev_isProcessingGridSelect; // UI init complete. now we can apply filter