// POPULATE THE DATAGRIDVIEW AND THEN INCLUDE THE FOLLOWING CODE IN ANY EVENT.HERE I AM USING IT IN A BUTTON CLICK EVENT.
private void button1_Click(object sender, EventArgs e)
{
int Total = 0;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
Total += Convert.ToInt32(dataGridView1.Rows[i].Cells["Columnname"].Value);
}
textBox1.Text = Total.ToString();
}
nice work.................
ReplyDelete