getAllRowIds in TreeGrid. How to get ALL of them

How to get all rows ids in treegrid - expanded and collapsed together?
getAllRowIds() returns only expanded (visible rows).
Of course I can use inner property of the grid that keeps array of all rows, but my question is if there is specific method to get them.
Thank you.