B
Booney440
Guest
I have a piece of code that it one cell is greater then another turn the cell red.
I am trying to change it to where if the condition is meet add text good to the cell and if not add Bad.
could someone give me a hand ?
Thanks
foreach (DataGridViewRow row in this.dataGridView1.Rows)
{
double value1;
double value2;
if (!double.TryParse(row.Cells[20].Value.ToString(), out value1) || !double.TryParse(row.Cells[6].Value.ToString(), out value2))
{
// throw exception or other handling here for unexcepted values in cells
}
else if (value1 > value2)
{
row.Cells[34].Style.BackColor = Color.Red;
Booney440
Continue reading...
I am trying to change it to where if the condition is meet add text good to the cell and if not add Bad.
could someone give me a hand ?
Thanks
foreach (DataGridViewRow row in this.dataGridView1.Rows)
{
double value1;
double value2;
if (!double.TryParse(row.Cells[20].Value.ToString(), out value1) || !double.TryParse(row.Cells[6].Value.ToString(), out value2))
{
// throw exception or other handling here for unexcepted values in cells
}
else if (value1 > value2)
{
row.Cells[34].Style.BackColor = Color.Red;
Booney440
Continue reading...