放在DataColChanged中也可以:
If e.DataCol.Name = "订单号" Then Dim dr As DataRow dr = e.DataTable.Find("订单号 = '" & e.NewValue & "'") If dr IsNot Nothing Then MessageBox.Show("此订单号已经存在!") e.Datarow("订单号") = nothing End IfEnd If