设置在AfterEdit事件中:
If e.col.Name = "装车" Orelse e.Col.Name = "卸车" Then
Dim Str1 As String = e.row("装车")
Dim Str2 As String = e.row("卸车")
If Str1 = "" Orelse Str2 = "" Then
e.Row("运价") = Nothing
Else
Dim dr As DataRow
dr = DataTables("运价表").Find("[装车] = '" & Str1 & "'And [卸车] = '" & Str2 & "'")
If dr Is Nothing Then
dr = DataTables("运价表").Find("[装车] = '" & Str2 & "'And [卸车] = '" & Str1 & "'")
End If
If dr IsNot Nothing Then
e.row("运价") = dr("运价")
End If
End If
End If