表1的DataColChanged事件中
IF e.dataCol.Name="状态" then
IF e.dataRow("状态")="取消" then
dim rList as List(of datarow) = datatables("表2").select("单号='" & e.datarow("单号") & "'")
for i as Integer = 0 to rList.Count - 1
rList(i)("状态")="取消"
next
end if
end if
表2的 DataCloChanged事件中
if e.dataCol.Name = "状态" then
IF e.dataRow("状态")="取消" then
dim rList as List(of datarow) = datatables("表2").select("单号='" & e.datarow("单号") & "'")
dim isCancel as Boolean = false
for i as Integer = 0 to rList.Count - 1
if rList(i)("状态")="确认" then
isCancel = True
end if
next
if isCancel=false then
datatables("表1").Find("单号='" & e.datarow("单号") & "'")("状态")="取消"
end if
end if
end if