Goran Bibic

Goran Bibic

  • 482
  • 2.9k
  • 197.1k

Auto refresh datagrid after insert value?

Apr 7 2018 10:09 AM
Auto refresh datagrid after insert value?
 
  1. private void dataGridView1_SelectionChanged(object sender, EventArgs e)  
  2.        {  
  3.            double[] columnData = new double[dataGridView1.Rows.Count];  
  4.            columnData = (from DataGridViewRow row in dataGridView1.Rows  
  5.                          where row.Cells["kolicina"].FormattedValue.ToString() != string.Empty  
  6.                          select Convert.ToDouble(row.Cells["kolicina"].FormattedValue)).ToArray();  
  7.            kolicinalabel.Text = columnData.Sum().ToString("#,0.00");  
  8.            button3_Click(null, null);  
  9.   
  10.   
  11.   
  12.            double[] columnData2 = new double[dataGridView1.Rows.Count];  
  13.            columnData = (from DataGridViewRow row in dataGridView1.Rows  
  14.                          where row.Cells["ukupno"].FormattedValue.ToString() != string.Empty  
  15.                          select Convert.ToDouble(row.Cells["ukupno"].FormattedValue)).ToArray();  
  16.            ukupnolabel.Text = columnData.Sum().ToString("#,0.00");  
  17.   
  18.            dataGridView1.Refresh();  
  19.   
  20.        } 
 

Answers (3)