欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

DevExpress GridView 当某个单元格值等于“查询值”时,改变单元格颜色

程序员文章站 2022-07-13 17:08:09
...
  Private Sub GridView_Dsheet_CustomDrawCell(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles GridView_Dsheet.CustomDrawCell
        On Error Resume Next
        If e.Column.FieldName = "列名" Then
            If InStr(isnull(GridView_Dsheet.GetDataRow(e.RowHandle).Item("列名"), ""), "查询字段值") > 0 Then
                e.Cell.Appearance.BackColor = Color.Red
            End If

        End If
    End Sub