Fixed crossthread.
This commit is contained in:
parent
1040a347c6
commit
77fc865636
2 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -151,7 +151,7 @@ namespace LibationWinForms
|
|||
{
|
||||
if (currProductsGrid != null)
|
||||
{
|
||||
gridPanel.UIThread(() => gridPanel.Controls.Remove(currProductsGrid));
|
||||
gridPanel.Controls.Remove(currProductsGrid);
|
||||
currProductsGrid.VisibleCountChanged -= setVisibleCount;
|
||||
currProductsGrid.Dispose();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue