If e.DataCol.Name = "数量" AndAlso e.DataRow.IsNull("名称") = False AndAlso e.DataRow.IsNull("数量") = False Then Dim sum As Double = e.DataTable.Compute("Sum(数量)","名称 = '" & e.DataRow("名称") & "'") For Each dr As DataRow In e.DataTable.Select("名称 = '" & e.DataRow("名称") & "'") dr("比例") = dr("数量") / sum Next End If