因为数值型列,是不能输入字符的,也就不能响应字符的按键
下面代码放到keydown事件
If e.KeyCode = Keys.W AndAlso e.Table.Current IsNot Nothing Then
e.Cancel = True
Dim r As Row = e.Table.Current
Dim v As Integer = Val(r(e.Table.ColSel))
If v >= 0 Then
v = v + 1
Else
v = v - 1
End If
r(e.Table.ColSel) = v
End If