那就必须在 出库明细表 记录原表的主键,类似的参考代码
If e.DataCol.Name = "出库拣货" Then
If e.DataRow("出库拣货") = True Then
Dim nma() As String = {"_Identify","物料品号","物料名称","每箱PC数","进库_箱数","进库_数量","库位号","出库日期"} '进库明细数据来源列
Dim nmb() As String = {"唯一标记","物料品号","物料名称","每箱PC数","出库_箱数","出库_数量","库位号","出库日期"} '出库明细数据接收列
Dim dr As DataRow = DataTables("出库明细").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
Else
DataTables("出库明细").deletefor("唯一标记 = '" & e.DataRow("_Identify") & "'")
End If
End If