diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 4e79785c02..4767c02c68 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -929,6 +929,9 @@ void wxGenericTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *da { wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); + if (data) + data->SetId( item ); + ((wxGenericTreeItem*) item.m_pItem)->SetData(data); }