Guys how do I set a column of a datagrid so that it will only accept numbers? I have this column labeled "Grade" which of course, should not accept letters. I have done setting its Format property but it is not working... Please
markdean.expres 0 Junior Poster
Recommended Answers
Jump to PostYOu have to use CellValidating event:
Private Sub dataGridView1_CellValidating(ByVal sender As Object, _ ByVal e _ As DataGridViewCellValidatingEventArgs) _ Handles dataGridView1.CellValidating Me.dataGridView1.Rows(e.RowIndex).ErrorText = "" Dim newInteger As Integer ' Don't try to validate the 'new row' until finished ' editing since there ' is not any point …
All 3 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.