Dim nms As New List(Of String)
Dim drs As New List(of DataRow)
With DataTables("库存明细表")
nms = .GetValues("产品ID")
For Each nm As String In nms '找出每个产品的第一行数据, 添加到集合drs中
dim dr As DataRow = .Find("产品ID = '" & nm & "'", "[_SortKey]")
If dr isnot Nothing then
drs.Add(dr)
End if
Next
For Each dr As DataRow In drs
.DataCols("入库数量").RaiseDataColChanged(dr)
Next
End With