-------------------------------------------------------------------
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int index = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "UnitPrice"));
if (index <= 30)
{
// e.Row.ForeColor = System.Drawing.Color.Red; // whole row will be red
e.Row.Cells[4].ForeColor = System.Drawing.Color.Red; // only the unitprice cell will be red.
}
}
else
{
}
}
0 comments:
Post a Comment