1、加一列,标记是否为默认地址。
2、当勾选成为默认地址的时候,编写datacolchanging事件
If e.DataCol.Name = "默认地址" andalso e.newvalue = true Then Dim fdr As DataRow = e.DataTable.Find("客户名称 = '" & e.DataRow("客户名称") & "' and 默认地址 = true") If fdr IsNot Nothing Then e.cancel = True msgbox("已存在默认地址") End IfEnd If