Change cell background color

This is a follow up to an earlier question. I am copying cells from a datagridview row to another datagridview row (that works). I want to change the value of a cell in the current row to "No" (that works). Now what I want to do is change the background of that cell or the text color.

Dim dr As DataRow = Me._CAD_050107DataSet.Tables("assignedvehicles").NewRow
        'Put values into row
        dr(1) = EventNumber.Text
        dr(2) = Datagridview1.CurrentRow.Cells(1).Value.ToString
        dr(3) = Datagridview1.CurrentRow.Cells(3).Value.ToString
        dr(4) = Datagridview1.CurrentRow.Cells(4).Value.ToString
        Me.Datagridview1.CurrentRow.Cells(7).Value = "No"
        Me.Datagridview1.CurrentRow.Cells(7).BackColor = System.Drawing.Color.Red
                                               Not working

        'and so on, making sure you put values in any ...
        '... fields/columns that do not allow null

LVL 13
Who is Participating?
Vee_ModConnect With a Mentor Commented:
Closed, 125 points refunded.
Community Support Moderator
wiswalldAuthor Commented:
I figured it out

Me.Datagridview1.CurrentRow.Cells(7).Style.BackColor() = Color.Red
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.