If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
doublemax wrote: ↑Sat Oct 16, 2021 8:38 am
You need to get the root item first. Which wxDataViewModel are you using? Or are you explicitly using wxDataViewTreeCtrl?
model is derived from wxDataViewModel
ctrl is derived from wxDataViewCtrl
I hope an invalid wxDataViewItem is the final root, and in model it is, but for wxDataViewCtrl::Expand, it isn't.
wxDataViewCtrl has no concept of "root" items. This is usually something related to tree controls. E.g. wxTreeCtrl has a single root item, but you have the option to hide it, so that only its children and descendants are visible.
So it all depends on your model. If you have one root item, you need to find the corresponding wxDataViewItem and excand it.
If you don't have a root item (or multiple, depending on how you see it), you must find them all and expand these one-by-one.