custom progress bar in a datagridview with threading
I am creating a program similar to a download manager. In my form(DownloadManagerForm.cs) I already created a datagridview with a custom progress bar(i found out i have to create classes called DataGridViewProgressColumn and DataGridViewProgressCell because datagridview does not support other controls). In my other class (BHO) i have to activate the DownloadManagerForm automatically and use a thread so it can facilitate multiple downloading. I used the Invoke method and a certain Callback. I noticed that when i run the program the progress bar starts with 0 then 100.I want to see the progress bar move slowly or at least see it move somehow. Please tell me what to add with my code.. Thanks
columnGraphics = new DataGridViewProgressColumn();
dataGridView1.Rows.Add(columnGraphics);
thrDownload = new Thread(Download);
thrDownload.Start();
-----------------------------------------------
Download()
{
.
.
.
this.Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { strLocal.Length, fileSize });
}
--------------------------------------
UpdateProgress
{
int PercentProgress = Convert.ToInt32((BytesRead * 100) / TotalBytes);
updatedProgress = ((float)PercentProgress);
Graphics.CellTemplate.Value = updatedProgress;
}
.
.
.
Class
DataGridViewProgressColumn and DataGridViewProgressCell