Add a label with the primary key of your table to the datagrid (make it invisible), find the row according to the label's value, and set the datagrid's row color accordingly.
If e.Row.RowType = DataControlRowType.DataRow Then
'Determine the value of the Actioned field and colour accordingly
Dim Actioned As String = (DataBinder.Eval(e.Row.DataItem, "Actioned"))
If Actioned = "False" Then
' Color the background of the row yellow
e.Row.BackColor = System.Drawing.Color.FromName("#D7E3F4")
ElseIf Actioned = "True" Then
' Color the background of the row yellow
e.Row.BackColor = System.Drawing.Color.FromName("#EFF3FB")
End If
End If
Bookmarks