From 033f0067227754211566a9cc1e2a52a53a70fb6e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 13 Apr 2020 14:18:11 +0200 Subject: [PATCH] Refresh the grid correctly when the selection mode changes Update the cells that had to be deselected due to the selection mode change. This used to work, but the refresh was lost during a previous refactoring. --- src/generic/gridsel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/generic/gridsel.cpp b/src/generic/gridsel.cpp index 25b7a82afd..0288f9a66a 100644 --- a/src/generic/gridsel.cpp +++ b/src/generic/gridsel.cpp @@ -128,7 +128,13 @@ void wxGridSelection::SetSelectionMode( wxGrid::wxGridSelectionModes selmode ) } if ( !valid ) + { + if ( !m_grid->GetBatchCount() ) + { + m_grid->RefreshBlock(block.GetTopLeft(), block.GetBottomRight()); + } m_selection.erase(m_selection.begin() + n); + } } m_selectionMode = selmode;