protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (DataBinder.Eval(e.Row.DataItem, "StaffName").ToString() == "Ram")
{
// color the background of the row yellow
e.Row.BackColor = Color.Yellow;
e.Row.ForeColor = Color.Green;
}
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (DataBinder.Eval(e.Row.DataItem, "StaffName").ToString() == "Ram")
{
// color the background of the row yellow
e.Row.BackColor = Color.Yellow;
e.Row.ForeColor = Color.Green;
}
}
}
No comments:
Post a Comment