private void dgvShow_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
DataGridViewRow dgr = dgvShow.Rows[e.RowIndex];
if (dgr.Cells["是否已回站"].Value.ToString() == "是")
{
if (e.RowIndex % 2 == 0)
{
dgr.DefaultCellStyle.BackColor = Color.LightCyan;
}
else
{
dgr.DefaultCellStyle.BackColor = Color.White;
}
}
else
{
dgr.DefaultCellStyle.BackColor = Color.Yellow;
}
}
绘制方法写
DataGirdView嵌套mdi中样式影响后的解决方案
最新推荐文章于 2022-06-11 22:12:08 发布