I'm using this function to add a column from 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 question is that there may be a column field of no value, there is an error, how do I add the column but only the fields that contain the value?