Open drosenba opened 8 years ago
I moved this line from BwFillViewsDoWork lvViews.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); to the end of the BwFillViewsRunWorkerCompleted method
and made this change private void ExportCurrentViewToExcel(string fileName) { WorkAsync(new WorkAsyncInfo("Retrieving records..", (w, e) => { // ---- if (lvViews.SelectedItems.Count == 0 || fetchXml == string.Empty) if (fetchXml == string.Empty)
and it now works OK.
I get this error when running in Visual Studio: An exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll but was not handled in user code Additional information: Cross-thread operation not valid: Control 'lvViews' accessed from a thread other than the thread it was created on.
It happens here:
... lvViews.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); }