<p>I have a page results page (you get there after submitting your search query elsewhere) whit a whole bunch of gridviews for different type of data objects.</p>

<p>Obviously, some of the queries take longer than the others. How can I make each gridview render as soon as it has the data it needs?</p>

<p>This has been tricky for me because it must work on a postback as well as a pageload. Also, the object data sources just fire automatically on page load/postback; I'm not calling any methods programatically to get the data. Will I have to change this? </p>

[{'answer_id': 59652, 'author': 'Gareth Jenkins', 'author_id': 1521, 'author_profile': 'https://Stackoverflow.com/users/1521', 'pm_score': 0, 'selected': False, 'text': "<p>Could you put the DataGrids inside panels that have their visibility set to false, then call a client-side javascript function from the body's onload event that calls a server side function that sets the visibility of the panels to true?</p>\n\n<p>If you combined this with an asp:updateProgress control and wrapped the whole thing in an UpdatePanel, you should get something close to what you're looking for - especially if you rigged the js function called in onload to only show one panel and call a return function that showed the next etc.</p>\n"}, {'answer_id': 59723, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 3, 'selected': True, 'text': "<p>@Gareth Jenkins</p>\n\n<p>The page will execute all of the queries before returning even the first update panel, so he won't save any time there.</p>\n\n<p>The trick to do this is to move each of your complex gridviews into a user control, in the user control, get rid of the Object DataSource crap, and do your binding in the code behind.</p>\n\n<p>Write your bind code so that it only binds in this situation: </p>\n\n<pre><code>if (this.isPostBack &amp;&amp; ScriptManager.IsInAsyncPostback)\n</code></pre>\n\n<p>Then, in the page, programaticly refresh the update panel using javascript once the page has loaded, and you'll get each individual gridview rendering once its ready.</p>\n"}]
['https://Stackoverflow.com/questions/59628', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/781/']