Select Case e.DataCol.Name
Case "日期","货物名称"
Dim dr As DataRow = e.DataRow
If dr.IsNull("日期") And dr.IsNull("货物名称") Then
dr("日期货物名称规格") = Nothing
Else
Dim n As String
If dr.IsNull("货物名称") = False Then
If dr("货物名称").length > 6 Then
n = dr("货物名称").SubString(0,6)
Else
n =dr("货物名称")
End If
End If
Dim g As String
If dr.IsNull("规格") = False Then
If dr("规格").length > 5 Then
g = dr("规格").SubString(0,5)
Else
g = dr("规格")
End If
End If
dr("日期货物名称规格") = Format(dr("日期"),"yyMM") & n & g
End If
End Select