From 54c5584c65e6e400261414ebd4f1bb3d7bbcca78 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 7 Jul 2018 20:29:37 +0200 Subject: [PATCH] Don't set column title if wxPG header is going to be hidden wxPropertyGridManager::SetColumnTitle() shouldn't be called when we going to hide the header because it makes the header visible. --- samples/propgrid/propgrid.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 4638bac948..5112f5a7e3 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -2703,8 +2703,12 @@ void FormMain::OnEnableLabelEditing(wxCommandEvent& event) #if wxUSE_HEADERCTRL void FormMain::OnShowHeader( wxCommandEvent& event ) { - m_pPropGridManager->ShowHeader(event.IsChecked()); - m_pPropGridManager->SetColumnTitle(2, wxT("Units")); + bool show = event.IsChecked(); + m_pPropGridManager->ShowHeader(show); + if ( show ) + { + m_pPropGridManager->SetColumnTitle(2, wxT("Units")); + } } #endif // wxUSE_HEADERCTRL