datacolchanged事件
If e.DataCol.Name = "交易详细信息" AndAlso e.NewValue > ""
Dim arr() As String = e.NewValue.replace(vbcr,"").split(vblf)
Dim str() As String = {"税金","投保金","材料款","工程款","生活费","投标费"}
For Each a As String In arr
If a.StartsWith("用途") Then
Dim idx As Integer = a.IndexOf("(")
If idx = -1 Then idx = a.Length
Dim s As String = a.SubString(2,idx-2).Trim
For Each f As String In str
If s.EndsWith(f) Then
e.DataRow("类别") = f
s = s.SubString(0,s.Length - f.Length)
Exit For
End If
Next
e.DataRow("用途") = s
Exit For
End If
Next
End If