1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Private Sub dgvSuc_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles dgvSuc.CellValidating
'-------------------------------------------------------------------
'Validation de la quantité suggérée
'-------------------------------------------------------------------
If e.ColumnIndex = 5 Then
'Colonne des quantités uniquement. Verification si la quantité est bien du numéric
If Not IsNumeric(e.FormattedValue) Then
Me.dgvSuc.Rows(e.RowIndex).Cells(5).Value = 0
Me.dgvSuc.Rows(e.RowIndex).Cells(e.ColumnIndex).ErrorText = "La valeur doit être numérique"
e.Cancel = True
Else
End If
End If
'====================================================
End Sub |
Partager