Changing background color of datagrid row in windows forms

sups123

Member
Joined
Mar 10, 2006
Messages
14
Programming Experience
1-3
Hello,

We have a datagrid in windows form. We want to change the background color of row according to some condition.

Got many examples in ASP.net but there are no examples of windows forms.

Please your reply will be highly appreciated.

Regards,
sups
 
Here are some ways to change colors to the GridView Component.

VB.NET:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].DataGridView1.RowsDefaultCellStyle.BackColor = Color
[/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].DataGridView1.BackgroundColor = Color
[/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].DataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color[/SIZE]
[COLOR=blue]Me.[/COLOR][COLOR=black]DateGrivView1.ForeColor = Color[/COLOR]

There are many other ways and colors you can alter on the DataGridView. It's a freaking confusing component and there should be a class dedicated just to that tool I think, lol. Anyways, I figured out that much using it myself.
 
Back
Top