DataColChanged事件中设置如下代码:
Select Case e.DataCol.Name
Case "品名描述","牌号材质","厚度","宽度"
Dim dr As DataRow = e.DataRow
Dim pr As DataRow
If dr.IsNull("品名描述") OrElse dr.IsNull("牌号材质") OrElse dr.IsNull("宽度") OrElse dr.IsNull("厚度") Then
dr("单价") = Nothing
Else
Dim filter As String
filter = "品名描述 = '" & dr("品名描述") & "' And 牌号材质 = '" & dr("牌号材质") & "' And 宽度 = '" & dr("宽度") & "' And 厚度 = '" & dr("厚度") & "'"
pr = DataTables("产品总表").Find(filter)
If pr IsNot Nothing Then
dr("单价") = pr("单价")
End If
End If
End Select