Dim t As Table = Tables("表A")
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式1")
cs1.backcolor = Color.red
Dim cs2 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式2")
cs2.backcolor = Color.green
For i As Integer = t.Position To t.Rows.count-1
If i <> t.Position Then
If t.Rows(i)("第二列") <> t.Rows(i-1)("第二列") Then
t.position = i
Exit For
End If
If t.Rows(i)("第一列") <> t.Rows(i-1)("第一列") Then
t.Grid.SetCellStyle(i+1, 1, cs2)
Else
t.Grid.SetCellStyle(i+1, 1, cs1)
End If
Else
t.Grid.SetCellStyle(i+1, 1, cs1)
End If
Next