Hi,
I'm a novice in C#. I wrote a program to export data from datagridview. While exporting, a pop-up window with a progress bar will show the progress of file being written. On the main form, I wrote:
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += delegate
{
//Code for exporting data
};
bgw.RunWorkerAsync();
FrmProgress progress = new FrmProgress();
progress.Show();
bgw.RunWorkerCompleted += delegate
{
progress.Close();
};
The pop-up window showed up while exporting, but the progressbar on the modal window is not updated. I tried bgw.ReportProgress but getting an error. Probably I didn't use it correctly. How do I update the progressbar in modal window? Can anyone please help me with this?
Thanks in advance!

Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 22, 2008, 2:01 AM EST
first you set your backgroundworker WorkerReportsProgress property to true to enable worker report its progress
Jan MontanoRank #1,295 · 1.3K reputationPosted Dec 21, 2008, 8:51 PM EST
Hi Mel,
Have you already solved your problem?
Regards,
jan
mel C8 reputationPosted Jan 4, 2009, 11:38 PM EST
Hi Jan,
Thanks for asking. I'd solved the problem.
mel C8 reputationPosted Jan 4, 2009, 11:42 PM EST
You are absolutely right. I didn't pass the value ated and called the eventhandler that's why the progress bar will not upd.
Thanks for your great answer! =D
arun d58 reputationPosted Apr 20, 2017, 8:54 AM EDT