Private Sub FormatGridRepeat()
Try
Dim rIDX As Integer = 0
Dim maxError As Decimal = 0
Dim blnFirstTime As Boolean = True
EH.ErrorMessage = String.Empty
If blnFormatRepeatabilityGrid Then
For Each row As DataGridViewRow In dgvRepeatability.Rows
If Not stcDefaultValues.repeatabilityMIN Is Nothing And Not stcDefaultValues.repeatabilityMAX Is Nothing Then
If CInt(row.Cells(2).Value) <> 0 Then
If blnFirstTime Then
blnFirstTime = False
If IsNumeric(row.Cells(4).Value) Then
maxError = CDec(row.Cells(4).Value)
End If
End If
If row.Cells(4).Value.ToString.Length > 0 Then
If IsNumeric(row.Cells(4).Value) Then
If CDec(row.Cells(4).Value) >= maxError Then
maxError = CDec(row.Cells(4).Value)
rIDX = row.Index
End If
End If
End If
If IsNumeric(row.Cells(4).Value) Then
If (CDec(row.Cells(4).Value) < CDec(stcDefaultValues.repeatabilityMIN)) Or (CDec(row.Cells(4).Value) > CDec(stcDefaultValues.repeatabilityMAX)) Then
dgvRepeatability.Rows(row.Index).Cells(4).Style.BackColor = Color.Salmon
End If
End If
End If
End If
Next
If CDec(dgvRepeatability.Rows(rIDX).Cells(2).Value) <> 0 Then
If (CDec(maxError) < CDec(stcDefaultValues.repeatabilityMIN)) Or (CDec(maxError) > CDec(stcDefaultValues.repeatabilityMAX)) Then
dgvRepeatability.Rows(rIDX).Cells(4).Style.BackColor = Color.Salmon
Else
dgvRepeatability.Rows(rIDX).Cells(4).Style.BackColor = Color.PaleGreen
End If
End If
End If
dgvRepeatability.ClearSelection()
Catch ex As Exception
EH.ErrorMessage = "frmCalibration_3/FormatGridRepeat() - " & ex.Message & "...Contact Engineering!" & "~E"
End Try
End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE