diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 21b4bc02de..ada42e388b 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2768,8 +2768,6 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData wxDataViewVirtualListModel *list_model = (wxDataViewVirtualListModel*) GetModel(); m_count = list_model->GetCount(); - - m_selection.OnItemsInserted(GetRowByItem(item), 1); } else { @@ -2860,6 +2858,8 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData InvalidateCount(); } + m_selection.OnItemsInserted(GetRowByItem(item), 1); + GetOwner()->InvalidateColBestWidths(); UpdateDisplay();