Dynamically adding a Button to a PlaceHolder in a DataGrid
<p>I have basically something like this:</p>

<pre><code>&lt;asp:datagrid id="DGrid" runat="server" AutoGenerateColumns="false"&gt;
  &lt;asp:TemplateColumn HeaderText="Stuff"&gt;
    &lt;ItemTemplate&gt; 
      &lt;asp:PlaceHolder id="PH" runat="server" /&gt;
    &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateColumn&gt;
&lt;/asp:datagrid&gt;
</code></pre>

<p>I need to add a Button to the PlaceHolder depending on the values of the data I am binding. At the moment I am adding the Button after the data is bound in Page_Load. The problem is that the data binding methods are not called in postbacks, so the Button disappears when I click on it.</p>

<p>Any suggestions on how to do this? Problem is that I need to know some attributes of the grid item to create the Button, so I cannot create it before the data has been bound.</p>
