This code works fine for making the cell’s background Blue:
DataGridViewRow dgvr = dataGridViewLifeSchedule.Rows[rowToPopulate];
dgvr.Cells[colName].Style.BackColor = Color.Blue;
dgvr.Cells[colName].Style.ForeColor = Color.Yellow;
…but the ForeColor’s effects are not what I expected/hoped: the font color is still black, not yellow.
How can I make the font color yellow?
You can do this:
You can also set whatever style settings (font, for example) in that cell style constructor.
And if you want to set a particular column text color you could do:
updated
So if you want to color based on having a value in the cell, something like this will do the trick: