ValidateEdit
If e.Col.Name = "姓名" Then Dim dr As DataRow = DataTables("表A").Find("姓名 = '" & e.Text & "'") If dr Is Nothing Then MessageBox.Show("请勿输入列表以外的姓名") e.Cancel = True End IfEnd If