If e.DataCol.Name = "编号" OrElse e.DataCol.Name = "客户名" Then If e.DataRow.RowState = DataRowState.Added Then Dim dr As DataRow = DataTables("明细表").AddNew() If e.DataRow.IsNull("编号") = False AndAlso e.DataRow.IsNull("客户名") = False Then dr("编号") = e.DataRow("编号") dr("客户名") = e.DataRow("客户名") Else dr("编号") = Nothing dr("客户名") = Nothing End If End If End If