Dear Sir,
How to combine these two conditions in one section
Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles DataGridView1.CellValidating
'condition 1
' check given value is numeric or charactr type
If e.ColumnIndex = 3 Then
If Not IsNumeric(e.FormattedValue) Then
DataGridView1.Rows(e.RowIndex).ErrorText = " must be a numeric value"
MsgBox("Must be a numeric value")
DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(3).Value = Nothing
e.Cancel = True
End If
End If
'condition 2
' check given value is greater than 0 or not
If e.ColumnIndex = 3 Then
If (e.FormattedValue.ToString = "0") Then
e.Cancel = True
MsgBox(" must be greater than 0")
End If
End If
End Sub