这样写比较精确
If e.DataCol.name Like "物料组_*" Then
Dim sum As Double = 0
For Each dc As DataCol In e.DataTable.DataCols
If dc.name Like "物料组_*" Then
sum += e.DataRow(dc.name)
End If
Next
e.DataRow("物料组合计") = sum
Else If e.DataCol.name Like "维修组_*" Then
Dim sum As Double = 0
For Each dc As DataCol In e.DataTable.DataCols
If dc.name Like "维修组_*" Then
sum += e.DataRow(dc.name)
End If
Next
e.DataRow("维修组合计") = sum
End If