Quote:I had this problem in a datagridview row where i have 3 columns. Datagridview data is loaded from query in vb.net. Below is the scenario: Column1 Column2 Column3 3 75 3 3 76 3 3 IP 0 3 NFE 0 If "Column2" cells contains "IP" or "NFE", "Column3" value is "0" BUT If "Column2" cells contains "75" or "76", "Column3" value is "EQUAL" to "Column1" I got this code where i used "For Each" loop; BUT sad to note that returns me this ERROR; "Conversion from string "IP" to type 'Double' is not valid." Please help me with this problem thank you.
Private Sub DGVGRADES_CellValueChanged(sender As Object, e As DataGridViewCellEventArgs) Handles DGVGRADES.CellValueChanged For Each row As DataGridViewRow In DGVGRADES.Rows If row.Cells(4).Value >= 75 Then row.Cells(0).Value = row.Cells(3).Value ElseIf row.Cells(4).Value.ToString <= 3 Then row.Cells(0).Value = row.Cells(3).Value ElseIf row.Cells(4).Value < 75 Then row.Cells(0).Value = 0 ElseIf row.Cells(4).Value = "IP" Then row.Cells(0).Value = 0 End If Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)