首页 > Windows开发 > 详细

设置DataGridView的单元格颜色

时间:2020-12-17 11:46:24      阅读:29      评论:0      收藏:0      [点我收藏+]

RowPrePaint事件:

private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)

{
if ("不存在" == this.dataGridView1.Rows[e.RowIndex].Cells["库位"].Value.ToString())
{
this.dataGridView1.Rows[e.RowIndex].Cells["库位"].Style.BackColor = Color.MediumPurple;
}
}

设置DataGridView的单元格颜色

原文:https://www.cnblogs.com/roak/p/14148013.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!