Handle item adding to DVC to a non-container node

This commit is contained in:
Ilya Sinitsyn
2022-03-17 00:04:55 +07:00
parent c7d0247258
commit e5bd3ecec6

View File

@@ -3094,6 +3094,14 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData
if ( !parentNode )
return false;
// If the parent has not children then just mask it as container and return.
// Nodes will be initialized in Expand().
if ( !parentNode->HasChildren() )
{
parentNode->SetHasChildren(true);
return true;
}
// If the parent has children but child nodes was not initialized then
// the node is collapsed so just return as nodes will be initialized in
// Expand().