DataColChanging事件
Select Case e.DataCol.Name
Case "第一列","第二列","第三列","第四列"
If e.DataRow.IsNull("第五列") Then
Dim arr() As String = {"第一列","第二列","第三列","第四列"}
Dim filter As String = "1=1 "
For Each cl As String In arr
If cl = e.DataCol.Name Then
filter &= " and " & cl & " = '" & e.NewValue & "'"
Else
filter &= " and " & cl & " = '" & e.DataRow(cl) & "'"
End If
Next
If e.DataTable.Find(filter) IsNot Nothing Then
msgbox("重复")
e.DataRow.Delete
End If
End If
End Select