日期:2014-05-17 浏览次数:20822 次
private void dgvPrdt_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
if (e.RowIndex >= dgvPrdt.Rows.Count) return;
DataGridViewRow dr = dgvPrdt.Rows[e.RowIndex];
if (string.IsNullOrEmpty(Convert.ToString(dr.Cells["QTY"].Value)))
{
dr.DefaultCellStyle.BackColor = Color.Yellow;
}
else if (string.IsNullOrEmpty(Convert.ToString(dr.Cells["QTY2"].Value)))
{
dr.DefaultCellStyle.BackColor = Color.Red;
}
}