Ashish Ashu
Ashish Ashu

Reputation: 14677

How to add progressbar column in DataGridView in C# (Winforms)

Is there any way so that I add a progress bar column in datagridview. Actually I need to show the progress for each rows (task) in the datagridview.

Let me know some sample code or links to acheive this functionality.

Upvotes: 4

Views: 13382

Answers (2)

MAC
MAC

Reputation: 6577

int percent = (int)(((double)progressBar1.Value / (double)progressBar1.Maximum) * 100);

progressBar1.CreateGraphics().DrawString(percent.ToString() + "%", new Font("Arial", (float)8.25, FontStyle.Regular), Brushes.Black, new PointF(progressBar1.Width / 2 - 10, progressBar1.Height / 2 - 7));

this is the code for progress bar.. check out

Upvotes: -2

Kostas Konstantinidis
Kostas Konstantinidis

Reputation: 13727

Check this MSDN post that has sample code inside.

Hope this helps.

Upvotes: 5

Related Questions