There is a code that counts the first column of the matrix.
int sum = 0; for (int i = 0; i < dataGridView1.Rows.Count; ++i) { sum += Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value); } label3.Text = sum.ToString(); how to modernize it so that it counts all the elements separately and brings them to the label, I don’t need the sum of all the columns at once, I need the comma separated the amount of each column in turn to be immediately output, with a single click on the button. What is there to put in a cycle to realize my idea?