日期:2014-05-17  浏览次数:20859 次

C#设置dataGridView某一个值的颜色?
C#设置dataGridView某一个值的颜色?就是其中个值超限了,我想把它标红显示。
dataGridView1.Columns[0].DefaultCellStyle.ForeColor = Color.Red;这个是整列都标红了,我只想要一个值标红,比如第3行第3列

------解决方案--------------------
dataGridView1.Rows[2].Cells[2].DefaultCellStyle.ForeColor = Color.Red;
------解决方案--------------------
dataGridView1.Rows[2].Cells[2].Style = new DataGridViewCellStyle() { ForeColor = Color.Red };