就比如我有2列,第一列1,2,3,第二列2,3,4,我要根据第一列的值来设置第二列的字体颜色(颜色不同),根据第一列的值设置第三列的背景颜色
------解决方案--------------------------------------------------------
该回复于2012-05-24 17:25:03被版主删除
------解决方案--------------------------------------------------------
Private Sub gv_list_RowCellStyle(ByVal sender As System.Object, ByVal e As DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs) Handles gv_list.RowCellStyle
Dim a As String = e.Column.FieldName
Dim i As Integer
If a = "verify_result" Then
i = e.RowHandle
Dim str As String
str = gv_list.GetRowCellValue(i, "verify_flag")
If gv_list.GetRowCellValue(i, "verify_confirm") = "通过" Then
Else
If gv_list.GetRowCellValue(i, "verify_flag") = "高" Then
e.Appearance.BackColor = Drawing.Color.Red
ElseIf gv_list.GetRowCellValue(i, "verify_flag") = "中" Then
e.Appearance.BackColor = Drawing.Color.Yellow
ElseIf gv_list.GetRowCellValue(i, "verify_flag") = "低" Then
e.Appearance.BackColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(218, Byte), Integer), CType(CType(169, Byte), Integer))
End If
End If
End If
End Sub