Colorare una colonna in Grigio






For Each oRow As DataGridViewRow In DataGridView1.Rows

Dim oStyle As New DataGridViewCellStyle()
oStyle.ForeColor = Color.Blue
oStyle.BackColor = Color.LightGray
oRow.Cells(4).Style = oStyle

Next



Dim Colore As System.Drawing.Color
Colore = Color.PaleGoldenrod
Do While Not Rs.EOF
Dim n As Integer = DataGridView1.Rows.Add()

If Colore = Color.PaleGoldenrod Then
Colore = Color.White
Else
Colore = Color.PaleGoldenrod
End If
......
Loop

DataGridView1.Rows(n).DefaultCellStyle.BackColor = Colore










( colorareunacolonnaingrigio.html )- by Paolo Puglisi - Modifica del 17/12/2023