I am new to winforms..I am trying to set two column of DataGridView to Numeric Only.. I do not want user to be able to type anything into a cell unless its a natural number
Try This with lambda
Private Sub dgv_pararelhp_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgv_pararelhp.EditingControlShowing
If dgv_pararelhp.CurrentCell.ColumnIndex = 0 Then'// change this optional your index column.
AddHandler CType(e.Control, TextBox).KeyPress, Sub(s_, e_)
If Char.IsDigit(CChar(CStr(e_.KeyChar))) = False Then e_.Handled = True
End Sub
End If
End Sub