用下面的代码,写到datacolchanged事件里去
Select Case e.DataCol.Name
Case "工序", "型号", "物品", "尺寸"
If e.DataRow.IsNull("工序") = False AndAlso e.DataRow.IsNull("型号") = False AndAlso e.DataRow.IsNull("物品") = False AndAlso e.DataRow.IsNull("尺寸") = False Then
Dim fdr As DataRow = DataTables("工序").Find("工序 = '" & e.DataRow("工序") & "' and 型号 = '" & e.DataRow("型号") & "' and 物品 = '" & e.DataRow("物品") & "' and 尺寸 = '" & e.DataRow("尺寸") & "'")
If fdr IsNot Nothing Then
e.DataRow("工价") = fdr("工价")
End If
End If
End Select