Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
ExpandAll nodes on XamDataGrid on initial display/load
posted

I need my View to have all the nodes expanded when the user navigates to it.

To achieve this, I have added the Loaded event of the gird, and perform a xamGrid.Records.ExpandAll(true). The timing is not correct though. At the time the Loaded event fires off, there are no records in the xamGrid, so there is nothing to expand. When I add a bit of a delay on the getter of my ObservableCollection (set as the datasource of the grid), the Records are present, and they correctly expand. This approach does not guarantee the success of the nodes expanding in all cases though (since the added delay is somewhat trivial).

I have also tried adding an event to the DataRecordPresenter(or something similar?) to expand the nodes. As with previous attempts on styling/working with the DataRecordPresenter, the rendering is inconsistent since there is a lag. Do you have any suggestions to achieve what I need? Please! :) Thanks.