void gvSample_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (int.Parse(e.Row.Cells[1].Text) < 10000)
e.Row.Attributes.Add("class", "GridVIewRowStyle_RedColor");
else if (int.Parse(e.Row.Cells[1].Text) > 10000 && int.Parse(e.Row.Cells[1].Text) < 20000)
e.Row.Attributes.Add("class", "GridVIewRowStyle_YellowColor");
else
e.Row.Attributes.Add("class", "GridVIewRowStyle_NoColor");
}
}
}
.GridVIewRowStyle_RedColor
{
border-right: #cccccc 0px solid;
border-top: black 0px solid;
padding-left: 8px;
background-color: Red;
text-decoration: none;
border-width: 1px;
border-color: black;
}