I need to add a progress bar in a DataGridView using DataTable or DataSet in a WinForms application similar to this:
There is no such thing as DataGridViewProgressColumn. To get an actual ProgressBar column will take some work - that is a ProgressBar that is embedded inside a cell...
The simplest way to achieve something like what you want is to have an animated .gif file within the relevant cell, so in this case you would use a DatGridViewImageColumn and select the required animate .gif as the image using a `PictureBox'.
To do smoothly will require multi-threading the process that you wish to show the progress of. The basic outline of how to do this would be
Choose your animated .gif file from this amazing site.
Import a Timer into your form and set the timer interval as '50'.
Create a picture box on you form and set its size to "1, 1" (very small) and the image source to your animated .gif.
Select this PictureBox as the DatGridViewImageColumn source image.
Then include the following code
private void yourTimerForGifAnimation_Tick(object sender, EventArgs e)
{
this.dataGridView1.Rows[someRow].Cells["My Progress Bar Column"].Value =
this.pictureBoxGif.Image
this.dataGridView1.InvalidateCell(cellColumnIndex, cellRowIndex);
}
This will create your animated progress image. Now all you need to worry about is not doing work on the UI thread as this will cause the animation to free along with everything else!
I hope this helps.