您的位置:首页 > 其它

DataGridView中根据条件改变行的底色

2010-08-04 17:18 169 查看
private void dataGridViewX1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (iii == 1)
{
if ((bool)dataGridViewX1.CurrentRow.Cells[0].Value)
dataGridViewX1.CurrentRow.DefaultCellStyle.BackColor = Color.Red;
else
dataGridViewX1.CurrentRow.DefaultCellStyle.BackColor = Color.Green;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: