Hello,
I have a question about how to limit the keyboard entry in a datagridview cell from a certain column. I have found many answers but all are a bit complicated so I wonder if there is a simpler way to do that.
So basically I have a DGV and I need all the cells from a specific column to contain only numbers and the "." sign.
The best way would be to stop the user by inputing any other character, so I would need like a keypress event for that cell...
If Char.IsDigit(e.KeyChar) Or e.KeyChar = ControlChars.Back Or e.KeyChar = "." Then
e.Handled = False
Else
e.Handled = True
End If
How can I do this for a DGV cell?
Thx.
I have a question about how to limit the keyboard entry in a datagridview cell from a certain column. I have found many answers but all are a bit complicated so I wonder if there is a simpler way to do that.
So basically I have a DGV and I need all the cells from a specific column to contain only numbers and the "." sign.
The best way would be to stop the user by inputing any other character, so I would need like a keypress event for that cell...
If Char.IsDigit(e.KeyChar) Or e.KeyChar = ControlChars.Back Or e.KeyChar = "." Then
e.Handled = False
Else
e.Handled = True
End If
How can I do this for a DGV cell?
Thx.