Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.net DataGridView rows alternating colors

Posted on 2012-03-26
3
Medium Priority
?
786 Views
Last Modified: 2012-03-30
Hi

What is the best way to color the alternating rows of a  DataGridView in two different colors.

Thanks
0
Comment
Question by:Murray Brown
3 Comments
 
LVL 38

Accepted Solution

by:
PaulHews earned 1000 total points
ID: 37766381
You set the styles at runtime or at design time:

With Me.DataGridView1
    .RowsDefaultCellStyle.BackColor = Color.White
    .AlternatingRowsDefaultCellStyle.BackColor = Color.Gainsboro
End With

Open in new window

0
 
LVL 14

Assisted Solution

by:athomsfere
athomsfere earned 1000 total points
ID: 37766424
In the properties window of the DataGridView you should also see the property for AlternatingRowsDefaultCellStyle.

Edit it there.
0
 

Author Closing Comment

by:Murray Brown
ID: 37786461
thanks very much
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question