If e.DataCol.Name = "客户编号" Then e.DataTable.replacefor("客户笔数",Nothing ,"[客户编号]= ' " & e.DataRow("客户编号") & " ' ") Dim Prs As List(Of String) Prs = DataTables("合同明细").GetValues("户名","客户编号= '"& e.newvalue &"'") For Each Pr As String In Prs e.DataRow("客户笔数")+=DataTables("合同明细").Compute("count(户名)","户名='"& Pr &"'") Next End If