I have need to retrieve all of the items in a Datagrid from an external application using UIAutomation. Currently, I can only retrieve (and view in UISpy) the visible items.
I am 99% sure that this is not possible. UI Automation doesn't know about the data structures which are represented by the currently visible portion of a grid. It only sees what is visible. I think that you will have to page through the grid to get all the data (that is what I do).
You can only retrieve the visible cells because you have table virtualization on.
Try disabling the virtualization (not always possible in all application but perhaps you want to move it into configuration and change it before testing)