2
Answers

Datagrid row background color

I have a Winforms app with a MS intrinsic datagrid on it (VS 2003 SP1).  I would like to set the background color on individual rows based on the value in one of the columns.  I can't seem to find any easy way to set a property on the control itself or code for it.

Fundamentally, I would like to use the background color to give a visual "cue" for the user, grouping like rows together.

So if I have a set that looks like this:

Row#          Key
1                 1
2                 1
3                 1
4                 2
5                 2
6                 2
7                 3
8                 3
9                 3
10               4
etc.


Has anyone else done this and can you point me in the right direction?

Thanks,
Dan
Answers (2)