After binding the data call the below function to make the empty cells as 0
private void MakeZeroForEmptyCells()
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
string value = Convert.ToString(cell.Value);
cell.Value = string.IsNullOrWhiteSpace(value) ? 0 : cell.Value;
}
}
}
and you shall call this function on
CellValueChanged
to update the data when the cell is filled with empty value.