Dynamically added table in asp.net not clearing styles
<p>I have a table who's rows are added dynamically in the code behind. The table sits inside an update panel:</p>

<pre><code> &lt;asp:UpdatePanel runat="server" ID="upnlPR"&gt;
        &lt;ContentTemplate&gt;
            &lt;asp:Table ID="tblPR" runat="server"&gt;
            &lt;/asp:Table&gt;
        &lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;
</code></pre>

<p>When I do a tblPR.Rows.Clear() in the code behind, the table draws itself up again correctly but it appears that the formatting that was applied to the row in that position before the redraw is still applied to the cell which is incorrect. Any idea why this is happening?</p>

<p>I have tried making the UpdatePanel updatemode conditional and doing a upnlPR.Update() after clearing the rows but this problem persists. Particular problems being: Styles applied to cell in that row number / cell position still applied, column span of the cell in that row number / cell position still applied.</p>

<p>Thanks!</p>

<p>(asp.Net, C#)</p>

<p>To style the cells <code>cell.CssClass = competencyAchievementView.ManagerScore &gt; competencyAchievementView.UserScore
                                                                            ? "manWorseScore"
                                                                            : "manBetterScore";</code></p>
