I’m using a ListView control to group items, so that the page can display 5 items, and I need to pyut the group index as a class.
How can I access the index of the index of the groups, like I can with the items? I’m looking to do something like the following:
<GroupTemplate>
<div class='<%# container.groupindex %>'>
<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
</div>
</GroupTemplate>
Is this possible?
After some more searching around SO I found this answer to another question:
Can I Number a GroupTemplate or ItemTemplate?
This has solved my problem, if a bit untidy.
If anyone knows a neater way I’m willing to accept.