25-02-24, 12:32 AM
كود :
Dim sum As Integer = 0
For Each row As DataGridViewRow In DataGridView1.Rows
If row.Cells(3).Value IsNot Nothing AndAlso row.Cells(3).Value.ToString() = "abrahim" AndAlso
row.Cells(2).Value IsNot Nothing AndAlso row.Cells(2).Value.ToString() = "True" Then
' Check if column 1 has a valid integer value and accumulate the sum
Dim value As Integer
If Integer.TryParse(row.Cells(1).Value.ToString(), value) Then
sum += value
End If
End If
Next
