user384725
user384725

Reputation: 1

How can I set the background color of individual cells in a DataGridView?

I have a DataGridView and I'm trying to change cell backgrounds based on the content of the cell. For example, if a cell's value is 5, then the cell's background should be blue.

Upvotes: 0

Views: 219

Answers (1)

Blorgbeard
Blorgbeard

Reputation: 103467

You could use the CellPainting event to check each cell's content and paint different background colors.

Upvotes: 1

Related Questions