Dim dr As DataRow = e.DataRow
If e.DataCol.Name = "销售数量"
If e.Newvalue > dr("可用量")
e.Cancel = True
MessageBox.Show("不能大于可用量!", "提示", MessageBoxButtons.OK, MessageBoxicon.Error)
Else
If e.Newvalue < 0
e.Cancel = True
MessageBox.Show("哇!请你不要乱填!", "警告", MessageBoxButtons.OK, MessageBoxicon.Error)
End If
End If
End If