I want to get the sum of a column of datagridview and show that in textbox. After each entry the sum should be changed dynamically. For that I am using textChanged event of
this is the best simple way :
private void your_name() { Double your_variable = dataGridView1.Rows.Cast().Sum(x => Convert.ToDouble(x.Cells["Column4"].Value)); this.textBox1.Text = your_variable.ToString("N2"); }