private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
sum += Convert.ToInt32(dataGridView1.Rows[i].Cells["mark"].Value.ToString());
textBox1.Text = Convert.ToString(sum);
}
}