Win App (DataGridView)
private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
int iRow = e.RowIndex;
DataGridViewRow r = DataGridView1.Rows[iRow];
double cellValue = Convert.ToDouble (r.Cells[5].Value); //UnitPriceif (cellValue <= 20)// ราคา/หน่วย ที่ < = 20
{r.DefaultCellStyle.BackColor = Color.Yellow ;
r.DefaultCellStyle.ForeColor = Color.Red;
}
}
อ่านเพิ่มเติมได้ที่: Greatfriends.biz:=> กำหนดสีของ DataGridView
ใส่ความเห็น