Click事件:
If e.Col.Name = "工厂" AndAlso e.Row.IsNull(e.Col) = False Then
e.Row("能做的产品") = ""
For Each dr As DataRow In DataTables("表B").DataRows
If dr("能做工厂").Contains(e.Row(e.Col)) Then
e.Row("能做的产品") + = dr("产品名称") & ","
End If
Next
e.Row("能做的产品") = e.Row("能做的产品").Trim(",")
End If