How to access all Items of a TreeDataProvider

Hi everyone

I want to expand all Items in my TreeGrid in Vaadin 8.6.3

According to the API I can use

  • this.treeTable.expandRecursively(rootElements, Integer.MAX_VALUE)
  • this.treeTable.expand(allElements)

Issue now is, after setting the DataProvider I directly want to call the expand method.
If I access the TreeData over treeGrid.getTreeData it is still empty, so I have no nodes to provide to the method call.

Anyone an idea on how I can display the TreeGrid to expand all items directly?
I understand if it wouldn’t be possible for BackEndHierachicalDataProvider that can be lazy loaded, but the TreeDataProvider should be an InMemoryDataProvider where all data is already loaded.

Thanks for any ideas or solutions.
Cheers