Hello,
I have a WHDG set up with one additional band. The grid has to be completely expanded on page load, so the InitialExpandDepth is set to -1. This works, however, the performance is desastrous. With about 40 parent rows and about 3 childrows each, I have to wait several seconds until the grid finally shows up.
If I set InitialExpandDepth to 0, the grid appears immediately, and I found out that the expansion of the parent rows actually happens in the browser, even though the HTML that is sent to the browser could already be fully expanded - since I already chose to expand everything on server side. I also tried to set the expanded state in the OnDataBound-event (grid.GridView.Rows[0].Expanded = true), but same result.
Questions:
1. Is there any way to have the rows in the rendered HTML expanded from start?
2. If not, is there a workaround to speed up the expansion (maybe beginUpdate/endUpdate surrounding the expansion process? I don't know where to hook in there)?
Hi,
Where did you see that the expansion of the parent rows happens in the browser? It happens through an ajax postback which then does full selects of the datasource and then filters out the couple of records you need. That's why it takes so long. If you set the initialdatabinddepth to -1, then you would have everything in the client, but you would see the same poor performance.
There's a way to select just the records you need for that page with manual load on demand, but it's a job to set up. Then you could set the initialexpanddepth to -1 and it should work nicely.
Ed
To clarify my situation:
I have alread set the InitialDataBindDepth="-1" , so that all data is already in the Browser. Then, because of InitialExpandDepth="-1", all rows are expanded - without a postback. I verified that no postback is performed, because otherwise my breakpoint in the Page_Load method would be hit.
So my problem ist not the binding or retrieval of data, but the javascript performance of the row expansion. If the rendered HTML would be in the expanded state from the beginning, the expansion afterwards would not be necessary.