If e.Row.IsNull("第一列") = False Then e.Table.DataTable.AddUserStyle("红色", Color.Red, Color.Black) Dim count1 As Integer = e.Table.DataTable.Compute("count(第一列)", "第一列 = '" & e.Row("第一列") & "'") Dim count2 As Integer = e.Table.DataTable.Compute("count(第一列)", "第一列 = '" & e.Row("第一列") & "' and 第二列 = 'a'") If count1 = count2 Then e.Style = "红色" End If End If