Set a certain row to have a back color of red

missshhhh

Member
Joined
Nov 26, 2006
Messages
13
Programming Experience
3-5
Hi, how would I set a certain row to have a back color of red base from the If...Else statement? Thanks.
 
Somethings like

VB.NET:
Expand Collapse Copy
    Private Sub setDGViewColor()
        Dim theRow As DataGridViewRow
        For Each theRow In Me.dgvList.Rows
            If theRow.Cells(7).Value.ToString() = "Deleted" Then
                theRow.DefaultCellStyle.BackColor = Color.Gray
            Else
                theRow.DefaultCellStyle.BackColor = Color.Black
            End If
        Next
    End Sub
 
Back
Top