+void wxDataViewCtrlBase::ExpandAncestors( const wxDataViewItem & item )
+{
+ if (!m_model) return;
+
+ if (!item.IsOk()) return;
+
+ wxVector<wxDataViewItem> parentChain;
+
+ // at first we get all the parents of the selected item
+ wxDataViewItem parent = m_model->GetParent(item);
+ while (parent.IsOk())
+ {
+ parentChain.push_back(parent);
+ parent = m_model->GetParent(parent);
+ }
+
+ // then we expand the parents, starting at the root
+ while (!parentChain.empty())
+ {
+ Expand(parentChain.back());
+ parentChain.pop_back();
+ }
+}
+