If e.DataCol.Name ="订单单号" Or e.DataCol.Name ="产品代码" Or e.DataCol.Name ="颜色" Then
If DataTables("销售订单明细").datarows("颜色") Is Nothing Then
Dim dt As DataRow = DataTables("销售订单明细").Find(" 订单单号 = " & "\'" & e.DataRow("订单单号") & "\'and 产品代码 = " & "\'" & e.DataRow("产品代码") & "\'and 颜色 = " & "\'" & e.DataRow("颜色") & "\'" )
If dt IsNot Nothing \'如果找到,则设置各列内容
e.DataRow("订单数量")= dt("订单数量")
End If
Else
Dim df As DataRow = DataTables("销售订单明细").Find(" 订单单号 = " & "\'" & e.DataRow("订单单号") & "\'and 产品代码 = " & "\'" & e.DataRow("产品代码") & "\'" )
If df IsNot Nothing \'如果找到,则设置各列内容
e.DataRow("订单数量")= df("订单数量")
End If
End If
End If