title: How to restrict non-numeric input in datagridview
body: <p>I'm hoping to find out a way to restrict a user from entering any non-numeric input into my datagridviewcolumn. Also I have already restricted the user from entering any negative numbers and from leaving the cell blank. If anyone can find a way to restrict the user from entering letters and non-numeric input I would greatly appreciate it!</p>
  
  <pre><code>If (e.ColumnIndex = 8) Then 'This specifies the column number
          Dim cellData = DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value
          If cellData Is Nothing OrElse IsDBNull(cellData) OrElse cellData.ToString = String.Empty Then
              MessageBox.Show("Cannot Be Empty")
              DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = 0
          ElseIf cellData &lt; 0 Then
              MessageBox.Show("Negatives Values Not Allowed")
              DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = 0
  
              Exit Sub
  
          End If
      End If
  </code></pre>