2
I’m using this function to add a column of my datagrid
public void Somatorio()
{
decimal total = 0;
foreach (DataGridViewRow row in dgv_inico.Rows)
{
total += Convert.ToDecimal(row.Cells["valor"].Value);
}
lbl_soma.Text = Convert.ToDouble(total).ToString("C");
}
The point is that there can be a field of the column without value, ai generates an error, as I do to add the column but only the fields that contain the value?
It worked, thank you very much.
– Bruno Felipe Kouuds