title: .net - Change Visibility of Template Column
body: <p>I am working with a web application in VS2010.  I want to change the visibility of a Template Column based on which button is pressed on the webpage. This is what I am currently doing:</p>
  
  <pre><code>&lt;asp:TemplateColumn &gt;
      &lt;ItemTemplate&gt;
          &lt;asp:LinkButton id="hlArchive" runat="server" ToolTip="ARCHIVE" 
                          Text="A" CommandName="Archive" CausesValidation="false" 
                          Visible="False"&gt;
              &lt;/asp:LinkButton&gt;
     &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateColumn&gt;
  </code></pre>
  
  <p>However, this leaves a small table on the screen.   Doing this gets rid of the empty table:</p>
  
  <pre><code>&lt;asp:TemplateColumn Visible="False"&gt;
  </code></pre>
  
  <p>But I cannot figure out how to change the visibility in the code when the time is right since there is no ID field.   Is there something similar to this that will let me do it?</p>
  
  <pre><code>hlArchive.Visible=true;
  </code></pre>