Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles DataGridView1.CellValidating Dim index As Integer = e.RowIndex If e.FormattedValue > CType(DataGridView1.Rows(index).Cells("PendingToLink").Value, Double) Then MessageBox.Show("Linked Qty must not be greater than pending to link") DataGridView1.CurrentRow.Cells("PresentLinkedQty").ErrorText = "Linked Qty must not be greater than pending to link" e.Cancel = True Else If Not DataGridView1.CurrentRow.Cells("PresentLinkedQty").ErrorText Is Nothing Then DataGridView1.CurrentRow.Cells("PresentLinkedQty").ErrorText = String.Empty End If End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)