我正在尝试对 ListView 项目(每行 2 个)进行分组,但我无法使其工作。这就是我正在使用的:
<asp:ListView ID="BookListView" runat="server" DataSourceID="SqlDataSource1"
onselectedindexchanged="BookListView_SelectedIndexChanged" GroupItemCount="2">
<LayoutTemplate>
<div>
<div ID="groupPlaceholder" runat="server">
</div>
<div style="text-align:center" runat="server">
<asp:DataPager ID="DataPager1" runat="server">
...........
</asp:DataPager>
</div>
</div>
</LayoutTemplate>
<GroupTemplate>
<div ID="itemPlaceholder" class="GroupTemplateContainerDiv" runat="server" style="clear:both">
</div>
</GroupTemplate>
<ItemTemplate>
<div class="ItemTemplateContainerDiv">
<div class="itemTemplateleftColumn">
..........
</div>
<div class="itemTemplaterightColumn">
..........
</div>
</div>
</ItemTemplate>
</asp:ListView>
除分组部分外,一切正常。有任何想法吗?提前致谢