I am using VB.net 2005 and would like a sample that works for it. I have a loop that goes thru the DataGridView and changes the row color based on a column/cell value from a binded DataTable (code shown below). I'd like to add to the loop (where the comment is) and hide the button for this cell and let the "In Process" show in the cell instead. Is there a simple way to do this? Thanks.
Private Sub ColorInProcessItems()
' Color the rows green if they are In Process, red if they are Complete
For Each row As DataGridViewRow In dgvQueue.Rows
If Not row.IsNewRow Then
If Not row.Cells(0).Value Is DBNull.Value Then
If row.Cells(7).Value.ToString = "In Process" Then
row.DefaultCellStyle.BackColor = Color.LimeGreen
'>>> Need code here to hide button and let "In Process"
' (the cells value from DataTable) show instead <<<
ElseIf row.Cells(7).Value.ToString = "Complete" Then
row.DefaultCellStyle.BackColor = Color.IndianRed
' Color blank dividing lines
If row.Cells(2).Value.ToString = "" Then
row.DefaultCellStyle.BackColor = Color.DimGray