title: asp:TableRow set visible property not working
body: <p>I'm working on a .NET 3.5 web application which shows/hides table rows contained in ascx files via an interface implementation (the controls containing the table implement the interface).</p>
  
  <p>So, given this markup in the .ascx:</p>
  
  <pre><code>&lt;asp:Table id="MyTable" runat="server"&gt;
  &lt;asp:TableRow ID="Foo" runat="server"&gt;
          &lt;asp:TableCell ID="FooCell"
              runat="server"  ColumnSpan="3"&gt;
              //Cell contents omitted
          &lt;/asp:TableCell&gt;
  &lt;asp:TableCell .... ellided
      &lt;/asp:TableRow&gt;
  &lt;/asp:Table&gt;
  </code></pre>
  
  <p>The interface:</p>
  
  <pre><code>public interface IMyInterface
  {
      Table GetPageDataTable();
  }
  </code></pre>
  
  <p>The implementation in the ascx's code behind:</p>
  
  <pre><code>#region IMyInterface Members
  
      public Table GetPageDataTable()
      {
          return MyTable;
      }
  
      #endregion
  </code></pre>
  
  <p>When I use a method like the one below from the containing page, as I loop through the table rows, the contains statement returns true however, the row's Visible property = false.</p>
  
  <pre><code>private void SetVisibleRows(IMyInterface control)
      {
          // the list stored in session contains 'Foo'
          List&lt;string&gt; choices = (List&lt;string&gt;)Session["selectionsList"]; 
  
          Table tbl = control.GetPageDataTable();
  
          foreach (TableRow r in tbl.Rows)
          {
              //r.ID == 'Foo'
              r.Visible = choices.Contains(r.ID, StringComparer.OrdinalIgnoreCase);
          }             
    }
  </code></pre>
  
  <p>I've also tried this directly in the control's codebehind, and even setting Foo.Visible = true; still shows visible = false in the debug window.</p>
  
  <p>Any help with this would be appreciated as it's driving me batty. I have another control which implements the interface and it's working fine for that one.</p>
  
  <p>Thanks!</p>