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
160
Expanding Rows always happens on Browser-Side - Bad Performance
posted

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)?

 

Parents
  • 5739
    posted

    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

Reply Children