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
675
Parallel.ForEach
posted

I have a grid with some unbound columns, and I try to fill the values with as Parallel.ForEach loop over all rows in the grid, but this don't work.

I get sometimes the following  error: System.NullReferenceException

I deaktivate some update events before the loop, but this didn't help.

A normal foreach-loop works perfect.

Is it generally posssible to you a Parallel.ForEach with a grid?

Parents
  • 29045
    Verified Answer
    Offline posted

    Hello Bodo, 

    Thank you for contacting Infragistics. The behavior you are seeing is clearly a blockage on the UI thread. Please clarify your requirement in using Parellel. What is the code in your Parellel loops and where is it performed? I advise not executing parallel loops on the UI Thread since this can lead to corruption, unexpected exceptions and deadlocks. I strongly encourage you to read over the following ms doc regarding potential pitfalls in data and task parallelism.

    Let me know if you have any questions. 

Reply Children