How to change gridview cell background image according to data from LINQ to entities?
<p>I am new to LINQ and ADO.net EF. I have a column called 'Change' in my ITM table which stores values of type double. I want to change the background image of the GridView cell according to the value in the 'Change' column retrieved using LINQ to Entites. Here's my code.</p>

<pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    using (mydbEntities myEntities = new mydbEntities())
    {
        foreach (var price in myEntities.ITMs)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (price.Change == 0)
                    e.Row.Cells[5].Attributes.Add("Style", "background: url(../Images/nc.png) no-repeat 5px center;");
                else if (price.Change &gt; 0)
                    e.Row.Cells[5].Attributes.Add("Style", "background: url(../Images/inc.png) no-repeat 5px center;");
                else if (price.Change &lt; 0)
                    e.Row.Cells[5].Attributes.Add("Style", "background: url(../Images/dec.png) no-repeat 5px center;");
            }

        }       

    }
}
</code></pre>

<p>When this code is run I get the same background image in every cell of the Gridview column regardless of the value. Any help will be appreciated.</p>
