Dim cols() As String={"生产单号","唛头","业务员"}For Each col As String In cols If e.DataCol.Name = col Then If e.NewValue Is Nothing Then MessageBox.Show(col & "不允许为空!") e.Cancel = True End If End IfNext