誰がどのドキュメントを所有しているかを示すレポートを作成するドキュメント管理システムがあります。文書を持っていない人がいる場合があります。その場合、その人のリピータ テーブルが表示されないようにしたいと考えています。私はしばらく見回しましたが、あまり運がありませんでした。おそらく、私が新しいためか、答えが見つからないためです。
リピーター内にリピーターをネストしていますが、最初のリピーターが表示されない場合は、残りが続く必要があります。
aspx ファイル
<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....
コードビハインド
// ...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();