datacolchanging事件
If e.DataCol.name = "第四列" AndAlso e.newvalue = True Then Dim count = e.DataTable.compute("count(第四列)", "第四列 = true") If count > 4 Then e.cancel = True msgbox("不能超过5") End IfEnd If