Pages

Saturday, November 27, 2010


-------------------------------------------------------------------



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

 

CodeAddict.com | Copyright 2009 Tüm Haklar? Sakl?d?r | Free Blogger Templates by GoogleBoy Download Free Wordpress Templates. Unblock through unblock myspace proxy, Hillsongs by Guitar Song Chords