I am working on a application which downloads using
1) Parallel.ForEach(linklist, x => DownloadAsync(x));
2) webClient.DownloadStringAsync(new Uri(link.Url));
class Link
{
string url;
string result;
int progress;
}
and updates the datagridview using INotifyPropertyChanged.
The problem is that the download is real fast, the datagridview updates first row, then the UI does not update, but then on moving the mouse cursor on datagridview rows one by one each row updates values.
I don’t understand where I am missing anything.
please any suggestings, thank you in advance.
EDIT: Async does not block the GUI, so i am not using background thread.
Although you don’t show your code, I assume you are updating UI elements from backgroud thread, which is something you should never do. If you are targeting WinForms you need to use
BackgroundWorkerorControl.Invoke.BackgroundWorker Component Overview
How to: Implement a Form That Uses a Background Operation
How can I update my user interface from a thread that did not create it?