Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
Can i change colors rows like example?
A 
B yellow
C
C
C
D yellow
D yellow
E
F yellow
F yellow
G


What I have tried:

            For NRow = 0 To DGV_Efatura.RowCount - 1
                R1 = .Rows(NRow).Cells(2).Value()
 If NRow < DGV_Efatura.RowCount - 1 Then
                    R2 = .Rows(NRow + 1).Cells(2).Value()
                Else
                    R2 = ""
                End If 
                If R1 = R2 Then .Rows(NRow).DefaultCellStyle.BackColor = Color.yellow
next 
Posted
Updated 4-Dec-20 22:42pm
v2

1 solution

Try this: Colouring DataGridView Cells According to their Content in WinForms[^] - the code is C#, but it's pretty obvious and online converters can help you with anything you don't understand.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900