If I set the Row Background color to Yellow in the GridView properties, is can show the color.
When I Try to code the condition make it change color, the color is no change.
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if( e.Row.RowType == DataControlRowType.DataRow)
{
try
{
string Level = ((System.Data.DataRowView)((GridViewRow)e.Row).DataItem).Row.ItemArray[5].ToString().Trim();
if ((Level.Equals("DM")) || (Level.Equals("I")) || (Level.Equals("CD")))
{
e.Row.Cells[3].BackColor = System.Drawing.Color.YellowGreen;
e.Row.Cells[4].BackColor = System.Drawing.Color.Violet;
}
//string strValue = DataBinder.Eval(e.Row.DataIte, "Level").ToString();
string c = "";
}
catch
{
}
}
}