title: How to Find td from the repeater in C#?
body: <p>I am have td in repeater. i want show and hide it on condition, i have used the below code to do it:</p>
  
  <p>My <strong>HTML</strong> code is:</p>
  
  <pre><code>&lt;table cellpadding="0" cellspacing="0"&gt;
      &lt;tr valign="top" class="list_heading"&gt;
          &lt;td width="50%"&gt;
              Column
          &lt;/td&gt;
          &lt;td width="20%"&gt;
              Operation
          &lt;/td&gt;
          &lt;td width="19%" style="display: none;"&gt;
              And/Or
          &lt;/td&gt;
          &lt;td width="20%"&gt;
              Value
          &lt;/td&gt;
          &lt;td width="20%" id="tdvalue2Header" visible="false" runat="server"&gt;
              Value2
          &lt;/td&gt;
          &lt;td width="10%"&gt;
              Remove
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tbody&gt;
          &lt;asp:Repeater ID="rpSearchItems" runat="server" OnItemDataBound="rpSearchItems_ItemDataBound"&gt;
              &lt;ItemTemplate&gt;
                  &lt;tr&gt;
                      &lt;td style="display: none;"&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;%# Eval("DisplayName") %&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;%# Eval("Operation") %&gt;
                      &lt;/td&gt;
                      &lt;td style="display: none;"&gt;
                          &lt;%# Eval("AndOr") %&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;%# Eval("Value") %&gt;
                      &lt;/td&gt;
                      &lt;td id="tdValue2" runat="server"&gt;
                          &lt;%# Eval("Value2") %&gt;
                      &lt;/td&gt;
                      &lt;td align="center"&gt;
                          &lt;asp:ImageButton ID="ibtnRemoveSearchItem" ImageUrl="~/Admin/Images/delete_icon.png"
                              CommandArgument=' &lt;%# Eval("Id") %&gt;' CssClass="RemoveUitem" ToolTip="Remove Item"
                              runat="server" OnClick="ibtnRemoveSearchItem_Click" /&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:Repeater&gt;
      &lt;/tbody&gt;
      &lt;tr valign="top" class="list_bottom"&gt;
          &lt;td colspan="6"&gt;
              &amp;nbsp;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;  
  </code></pre>
  
  <p>And here is the item_dataBound code:</p>
  
  <pre><code>protected void rpSearchItems_ItemDataBound(object sender, RepeaterItemEventArgs e)
  {
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
      {
          DataRowView drv = e.Item.DataItem as DataRowView;
  
          //HtmlTableCell tdValue2 = (HtmlTableCell)rpSearchItems.FindControl("tdValue2");
          TableCell tdValue2 = (TableCell)rpSearchItems.FindControl("tdValue2");
          if (drv.Row["Value2"].ToString() != "")
          {
              tdvalue2Header.Visible = true;
              hdfShowSecondValueColumn.Value = "11";
              if (tdValue2 != null)
              {
                  tdValue2.Visible = true;
              }
          }
          else
          {
              if (hdfShowSecondValueColumn.Value != "11")
              {
                  tdvalue2Header.Visible = false;
                  if (tdValue2 != null)
                  {
                      tdValue2.Visible = false;
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>always <strong>tdValue2</strong> i got null, i dont know where is i am wrong, please help me.</p>