conditional change of a datagridviews cell background color and text

后端 未结 3 651
醉话见心
醉话见心 2021-01-12 12:15

This is for a winform vb.net 2008 app. I\'m bringing data back from a database and based on some static conditions... i want to change the color of the background and the t

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-12 12:41

    I got it working... in the RowPostPaint event.. If I put in

    if (my criteria here)
        Me.dgTableInfo.Rows(e.RowIndex).Cells("ColumnName").Style.BackColor = Color.Red
    end if
    

提交回复
热议问题