Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight Data binding taking an age & locking gui
    text
    copied!<p>We have a web service that picks up a report from a server and returns it to the Silverlight GUI. In the GUI we have an event handler that calls the following function:</p> <pre><code> private void PopulateDataGrids() { try { reportTitle = reportDataUtil.ReportHeader.Rows.First(r =&gt; r.Items[ReportTools.FIELDNAME_STRING].ToString() == ReportTools.FIELDVALUE_TITLE).Items[ReportTools.FIELDVALUE_STRING].ToString(); dg_Report_Header.DataSource = reportDataUtil.ReportHeader; dg_Report_Header.CanUserSortColumns = false; dg_Report_Header.CanUserReorderColumns = false; dg_Report_Header.CanUserResizeColumns = true; dg_Report_Header.DataBind(); dg_Report_Header.UpdateLayout(); dg_Report_Detail.DataSource = reportDataUtil.ReportDetails; dg_Report_Detail.CanUserSortColumns = true; dg_Report_Detail.CanUserReorderColumns = true; dg_Report_Detail.CanUserResizeColumns = true; dg_Report_Detail.DataBind(); dg_Report_Detail.UpdateLayout(); //Hide the ElementID colmun if (dg_Report_Detail.Columns.Count &gt; 0) { var col = dg_Report_Detail.Columns.FirstOrDefault(dc =&gt; dc.Header.ToString() == NetVisSolution.Reports.ReportTools.COLUMNNAME_ELEMENTID); if (col != null) { col.Visibility = System.Windows.Visibility.Collapsed; } } } catch (Exception) { ClearResources(); closeReportDataViewer(); ErrorWindow.CreateNew("Unable to open selected report data, the file maybe corrupted or not \nin the server specified location."); //throw new Exception(ex.Message, ex.InnerException); } } </code></pre> <p>Trouble is, the detail table can be 14000 rows long, taking up more than a megabyte. When such a report is loaded, the dg_Report_Detail.DataBind(); call takes several minutes and locks up the GUI.</p> <p>Is there a simple way to do this asynchronously or in such a manner that the application remains responsive?</p> <p>Thanks in advance,</p> <p>--- Alistair.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload