drawcell事件,代码
e.Table.DataTable.AddUserStyle("样式1", color.Red, Color.Black)e.Table.DataTable.AddUserStyle("样式2", color.blue, Color.Black)
static pys As String = ""static pr As Row = NothingIf e.Row.Index = 0 Then pys = "样式1"Else If e.Row("第一列") <> pr("第一列") Then If pys = "样式1" pys = "样式2" Else pys = "样式1" End If End IfEnd Ifpr = e.Rowe.Style = pys