
Try
Dim total As Decimal = 0
For Each row As DataGridViewRow In DgTotales.Rows
'carga el textbox con el total de lo vendido en el periodo seleccionado
If total = CDec(total + Val(row.Cells(1).Value) * Val(row.Cells(2).Value)) = True Then
Textgrantotal.Text = CStr(total.ToString("#,##0.00€"))
'carga el label con el total de lo vendido en el periodo seleccionado
'LbSumaTotal.Text = CStr(total.ToString("#,##0.00€"))
Else
Textgrantotal.Text = ("#,##0.00€")
End If
Next
Catch
End Try
Textgrantotal.Text = ("#,##0.00€")
End If
Next
Catch
End Try