Using VS2010 VB.NET, I have a datagridview (dgv) where I set the background color of cells according to a certain value. This particular cell does not store any information and therefore I can not use the data in that cell to determine the background color.
My current attempts are a complete failure and MSDN is only particular to "setting" and not "getting" the background color of a cell.
Code I've tried"
if dgvNotes.Rows(clickedCell.RowIndex).Cells(1).Style.BackColor.ToString = "Red" then
if dgvNotes.Rows(clickedCell.RowIndex).Cells(1).Style.BackColor = Color.Red then
I am not able to find much information on the topic as most of the posts on various coding sites focusses on "setting" the background color.
Is there any way that I can determine cell background color after the dgv was populated ? Thanks
write in cell click event
This is not working for me
I have this code for setting the cells color and other properties
When I comment the line where I add the white color I get this
if i supress the comment slashes
I get this
In the click event