以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 子表全部勾选后主表勾选 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=169564) |
-- 作者:yuyaolz -- 发布时间:2021/6/21 11:30:00 -- 子表全部勾选后主表勾选 If e.DataCol.name = "已领完" Then Dim pr As DataRow = e.DataRow.GetParentRow("领料主表") If pr IsNot Nothing Then Dim crs As List(of DataRow) = pr.GetChildRows("领料明细表") For Each cr As DataRow In crs If cr("已领完") = True Then pr("已领完") = True Else pr("已领完") = False End If Next End If End If 老师这代码应该怎么写,我上面代码结果不正确,要求子表所有行全部勾选后,相关主表一行勾选
|
-- 作者:有点蓝 -- 发布时间:2021/6/21 11:34:00 -- If e.DataCol.name = "已领完" Then Dim pr As DataRow = e.DataRow.GetParentRow("领料主表") If pr IsNot Nothing Then Dim crs As List(of DataRow) = pr.GetChildRows("领料明细表") For Each cr As DataRow In crs If cr("已领完") = false Then pr("已领完") = False return End If Next pr("已领完") = True End If End If
|
-- 作者:yuyaolz -- 发布时间:2021/6/21 12:14:00 -- 谢谢蓝老师 非常NICE |