title: rowcommand in dynamically created gridviews
body: <p>I've got serious gridview trouble.
  The rowcommand in my dynamically created gridview isn't firing. </p>
  
  <pre><code>            Controls_ucOffice userControl = (Controls_ucOffice)LoadControl("~/Controls/ucOffice.ascx");
              userControl.ID = *Unique ID*
  
              GridView gvPhones =(GridView) userControl.FindControl("myGridView");
              gvPhones.DataSource = cPhoneList;
              gvPhones.DataBind();
  
              placeholder1.Controls.Add(userControl);
  </code></pre>
  
  <p>i'm making several of these controls, and they all appear fine with the gridviews, with the right data. 
  this is done on a button click and not on page_load.</p>
  
  <p>i know they dissappear on postback so i've placed them in update panels, to avoid losing the gridviews (populating them takes quite a while)</p>
  
  <pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
  &lt;ContentTemplate&gt;
      &lt;asp:GridView runat="server" ID="gvPhones" AutoGenerateColumns="false" OnRowDataBound="gvPhones_RowDataBound"
              OnRowCommand="gvPhones_RowCommand"&gt;
  &lt;/ContentTemplate&gt;
  &lt;Triggers&gt;
      &lt;asp:AsyncPostBackTrigger ControlID="gvPhones" EventName="RowCommand" /&gt;
  &lt;/Triggers&gt;
  </code></pre>
  
  <p></p>
  
  <p>after putting them in the update panel, at first click nothing happens, second click makes all the gridviews dissappear (as in there was a postback)</p>
  
  <p>the breakpoint in the rowcommand method below is never reached</p>
  
  <pre><code>protected void gvPhones_RowCommand(object sender, GridViewCommandEventArgs e)
  {
      //do stuff
  }
  </code></pre>