日期:2014-05-17 浏览次数:20996 次
private void dataGridViewPanel_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.Value.ToString() != "" && e.RowIndex == 9 && decimal.Parse(dataGridViewPanel.Rows[9].Cells[e.ColumnIndex].ToString()) < decimal.Parse(dataGridViewPanel.Rows[3].Cells[e.ColumnIndex].ToString()))
{
e.CellStyle.BackColor = Color.Red;
}
}
decimal.Parse(dataGridViewPanel.Rows[9].Cells[e.ColumnIndex].ToString()
这句错了,少了个Value
decimal.Parse(dataGridViewPanel.Rows[9].Cells[e.ColumnIndex].Value.ToString()