wiswalld
asked on
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.Tabl es("assign edvehicles ").NewRow
'Put values into row
dr(1) = EventNumber.Text
dr(2) = Datagridview1.CurrentRow.C ells(1).Va lue.ToStri ng
dr(3) = Datagridview1.CurrentRow.C ells(3).Va lue.ToStri ng
dr(4) = Datagridview1.CurrentRow.C ells(4).Va lue.ToStri ng
Me.Datagridview1.CurrentRo w.Cells(7) .Value = "No"
Me.Datagridview1.CurrentRo w.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
Me._CAD_050107DataSet.Tabl es("assign edvehicles ").Rows.Ad d(dr)
Dim dr As DataRow = Me._CAD_050107DataSet.Tabl
'Put values into row
dr(1) = EventNumber.Text
dr(2) = Datagridview1.CurrentRow.C
dr(3) = Datagridview1.CurrentRow.C
dr(4) = Datagridview1.CurrentRow.C
Me.Datagridview1.CurrentRo
Me.Datagridview1.CurrentRo
^
Not working
'and so on, making sure you put values in any ...
'... fields/columns that do not allow null
Me._CAD_050107DataSet.Tabl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Me.Datagridview1.CurrentRo