Getting error: "Control Collection Can Not Be Modified"
<p>Hi i am initially using this code but now when i am debuging this code i am getting error ..</p>

<p>"The Controls collection cannot be modified because the control contains code blocks "</p>

<p>my code is:</p>

<pre><code>for (int m = 0; m &lt; dtGroupedByDate.Rows.Count; m++)
{
    Label Date = new Label();
    Date.Text = dtGrpBySmDate.Rows[m][0].ToString();
    Date.Style["margin-left"] = (m &gt; 0) ? "20px" : "0px";
    this.Controls.Add(Date);
    Label PowerSum = new Label();
    PowerSum.Text = dtGroupedByDate.Rows[m][1].ToString();
    PowerSum.Style["margin-left"] = "20px";
    this.Controls.Add(PowerSum);
}
</code></pre>

<p>Please help me why i am getting this error..</p>
