Hi,
I'm using VB.NET 2005, and would like to color a cell on a DataGridView if an exception has been invoked. I have the following code snippet:
Code:
' ############ GET THE NEW 'FROM' DATE ############
Try
tblRow.Item("From") = Convert.ToDateTime(strNewFromDate)
Catch ex As Exception
' Problem with this date field, so leave blank
' Add 1 to the number of warnings count
intNumberOfWarnings += 1
' Colour the cell in error
End Try
Is there a clever bit of code I need to use that will allow me to color this particular cell?