Asp.Net-转发器内的ListView
我的中继器的数据源是一本字典 我希望中继器显示字典的所有键,我希望ListView使用字典值中的所有数据 它应该生成某种容器。容器获取字典的名称键,并获取与该键关联的字典的许多值 现在,我得到了这样的东西:Asp.Net-转发器内的ListView,listview,asp.net-3.5,repeater,Listview,Asp.net 3.5,Repeater,我的中继器的数据源是一本字典 我希望中继器显示字典的所有键,我希望ListView使用字典值中的所有数据 它应该生成某种容器。容器获取字典的名称键,并获取与该键关联的字典的许多值 现在,我得到了这样的东西: <asp:Repeater ID="rpt" runat="server"> <ItemTemplate> <asp:ListView ID="lv" runat="server"> <LayoutTemplate>
<asp:Repeater ID="rpt" runat="server">
<ItemTemplate>
<asp:ListView ID="lv" runat="server">
<LayoutTemplate>
<table>
<tr>
<td colspan="2">
GroupName (should be take from the key of the dictionary)
</td>
</tr>
<tr id="trConfigurationHeader">
<th>Name</th>
<th>Description</th>
</tr>
<asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td><%#Eval("Name")%></td>
<td><%#Eval("Description")%></td>
</tr>
</ItemTemplate>
</asp:ListView>
</ItemTemplate>
</asp:Repeater>
如何绑定我的ListView?在外部Repeater控件的ItemTemplate中显示键要容易得多。 您可以执行以下操作。不确定如何在内部容器列表视图中显示键
<asp:Repeater ID="rpt" runat="server" >
<ItemTemplate>Group :
<asp:Label ID="dd" runat="server" Text='<%# Eval("Key") %>' ></asp:Label>
<asp:ListView ID="lv" runat="server" DataSource='<%# Eval("Value") %>' >
<LayoutTemplate>
<table>
</tr>
<tr id="trConfigurationHeader">
<th>Name</th>
<th>Description</th>
</tr>
<asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td><%#Eval("Name")%></td>
<td><%#Eval("Description")%></td>
</tr>
</ItemTemplate>
</asp:ListView>
</ItemTemplate>