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
2730
UltraListView Collection error
posted

I am using a background worker for some reason I am getting an error that saids collection cannot be modified error, I am basically launching the Listview thats on a form, to always give me import status on data on a list view, I am able to close and open the list view at any given time.

Can someone point me how to get pass this error when I am trying to launch the form to look the update of the list view.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

public void LoadList(List<ImportLog> ImportList)

{

 

 

if (ImportList != null){

 

 

 

// save the ImportStatusList for later

 

 

 

this.ImportStatusList = ImportList;

 

 

 

foreach (ImportLog Status in this.ImportStatusList)//Error occurs

{AddStatus(Status);}

}

 

 

 

else

{

 

 

 

MessageBox.Show("Message Viewer is Empty"

);

Visible =

 

false;

Parents
  • 469350
    Offline posted

    Where does the Background worker thread come in?

    What is ImportStatusList in this code? Is that the UltraListView? 

    Are you saying that you are referring to the UltraListView control (which is on the UI Thread) from another thread?

    You cannot do that.

Reply Children