I need to hide a column in an asp:repeater. Preferably, hide them server side not just in HTML via CSS. The repeater has an ID, but I am having difficulty finding the table that it owns within the debugger. Considering how a repeater works I’m not sure its even possible. I gave the HTML table an ID and set it to runat="server", but it blew up with error
Unexpected end of file looking for
tag.
How can I do it? Do I need to switch to a gridview? I could probably do this a lot easier with a gridview.
<asp:repeater id="repeaterId" runat="server">
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "col1")%></td>
<td nowrap="nowrap" align="left"><%# DataBinder.Eval(Container.DataItem, "col2")%></font></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate> <tr>
<td><%# DataBinder.Eval(Container.DataItem, "col1")%></td>
<td nowrap="nowrap" align="left"><%# DataBinder.Eval(Container.DataItem, "col2")%></td>
</AlternatingItemTemplate>
<HeaderTemplate>
<table id="rPhysicalTable" class="cssTable">
<tr class="aClass">
<th>col1</th>
<th>col2</th>
</tr>
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:repeater>
Following Tim Schmelter’s advice I switched to a gridview. This way I can use
And thus avoid hiding multiple
<td>in a repeater.