您的位置:首页 > Web前端 > CSS

DataGirdView嵌套mdi中样式影响后的解决方案

2015-08-17 10:46 471 查看
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;
}

}
绘制方法写
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: