Windows Develop Bookmark and Share   
 index > Windows Forms General > Listview Alternate Row Color
 

Listview Alternate Row Color

Can anyone please help me implement alternate row color in the listview control... It would be more helpful if it's in a step by step approach.... Thanks in advance.
a{k}{3}{V}{1}{n}  Saturday, May 12, 2007 3:58 PM
when you add items to your listview control, just count rows and on every second row change the background color.

like this:

if (row++ % 2 == 0)
item.BackColor = Color.Beige;
xkelt  Saturday, May 12, 2007 4:50 PM
when you add items to your listview control, just count rows and on every second row change the background color.

like this:

if (row++ % 2 == 0)
item.BackColor = Color.Beige;
xkelt  Saturday, May 12, 2007 4:50 PM

You can use google to search for other answers

Custom Search

More Threads

• Limit the number of selected Items in a Listview
• Adding DLL as reference to each class lib project???
• a good book about windows form
• Position Winforms Menu when overriding Non-Client Painting
• Eh... You're not going to believe this...
• Baseform causing problems
• Win Forms Web Services - Batch Processing/Console Apps
• How can i get the current string width in textbox of C#
• Visual Inheritance Issues
• Problem with closing maximized windows in MDI Program