Protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType==DataControlRowType.DataRow)
{
//Retives the DataItem value from row into Marks variable
//Total_Marks is Grdview database coloumn name
int Marks=(int)DataBinder.Eval(e.Row.DataItem, "Total_Marks");
if(Marks>500)
e.Row.BackColor=System.Drawing.Color.Red;
else
e.Row.BackColor=System.Drawing.Color.Blue;
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment