I have a document management system which creates a report showing people who own which document. There are times where people have 0 documents and in that case I would like the repeater table for that person to not be visible. I have looked around for a while and have not had much luck, maybe its because I am new or maybe its because I havent found my answer.
I have repeaters nested inside repeaters but if the first repeater is not visible the rest should follow.
aspx file
<h3> <%# DataBinder.Eval(Container.DataItem, "FullNm") %></h3>
<table ID="CollectorTable" runat="server" class="report-totals">
<tr>
<th>Total Collected:</th>
<td><asp:Literal ID="CollectorTotalCollected" runat="server" /></td>
<td class="report-totals-spacer"></td>
<th>Total Contacted:</th>
<td><asp:Literal ID="CollectorTotalContacted" runat="server" /></td>
<td class="report-totals-spacer"></td>
<th></th>
<td></td>
</tr>
</table>
// etc....
Code Behind
// ...pull totals
Control CollectorRepeater = new Control();
CollectorRepeater = (Control)e.Item.FindControl("CollectorRepeater");
CollectorRepeater.Visible = false;
Repeater collectorData = (Repeater)item.FindControl("CollectedTableRepeater");
collectorData.DataSource = collectedDocuments;
collectorData.DataBind();
Repeater contactedData = (Repeater)item.FindControl("ContactedTableRepeater");
contactedData.DataSource = contactedDocuments;
contactedData.DataBind();