I have a data grid view and trying to compare data in coloumn 4 with coloumn 6 when data is entered in coloumn 6. but comparision is not happening . How to achive this.
my code
Private Sub DgvAllocate_CellLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DgvAllocate.CellLeave
Crno = DgvAllocate.CurrentRow.Index
If e.ColumnIndex = 6 Then
If DgvAllocate.Rows.Item(Crno).Cells(5).Value() = "X" Then
If DgvAllocate.Rows.Item(Crno).Cells(4).Value() < DgvAllocate.Rows.Item(Crno).Cells(6).Value Then
DgvAllocate.Rows.Item(Crno).Cells(6).Value() = DgvAllocate.Rows.Item(Crno).Cells(4).Value
Else
End If
End If
End If
End Sub