Hi,
How can I valide value in DataGridViews cell? I was trying to do it like that:
VB Code:
Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles DataGridView1.CellValidating If Me.DataGridView1.CurrentCellAddress.X = 1 Then If Not IsNumeric(Me.DataGridView1.CurrentCell.Value) Then e.Cancel = True MessageBox.Show("cell contains wrong value") End If End If End Sub
But this code returns error regardless of value that was entered into cell.
Please help,
Regards,
sweet_dreams





Reply With Quote