From 9f5af0a49489d2123db83daa58e3b67ec9b8fe09 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 11 Jan 2015 22:49:21 +0000 Subject: [PATCH] Fix selection of items inserted in virtual generic wxDataViewCtrl. Call wxSelectionStore::OnItemsInserted() explicitly instead of just using our UpdateCount() to update the count of items managed by the selection. This needs to be done to ensure that the newly added items have the correction selection, i.e. are always unselected, as previously this wasn't the case: if wxSelectionStore was in the "selected by default" state as it happened e.g. after selecting all the items in the control, the new items also ended up being selected. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datavgen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 12b5b0bf14..283dc5799c 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2304,7 +2304,9 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData { wxDataViewVirtualListModel *list_model = (wxDataViewVirtualListModel*) GetModel(); - UpdateCount(list_model->GetCount()); + m_count = list_model->GetCount(); + + m_selection.OnItemsInserted(GetRowByItem(item), 1); } else {