Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How can I get count of items in UniView control View modes: 
User avatar
Member
Member
joeh42 - 8/2/2011 7:55:24 PM
   
How can I get count of items in UniView control
I want to generate a named anchor on the last item in a uniview control. Within the item template, how can I get a count of the items in the control? It seems like it implements GetItemsCount via IEnumerable, but that's not accessible due to its protection level for some reason.

How can I get to it?


<cms:UniView runat="server" ID="listForums" EnableViewState="false">
<ItemTemplate>
<%# ((UniViewItem)Container).DisplayIndex == ((UniView)Container.Parent).GetItemsCount() ? "named anchor" : String.Empty %>
</ItemTemplate>


Thanks!
Joe Hoppe

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 8/3/2011 9:21:53 AM
   
RE:How can I get count of items in UniView control
Hello,

Could you please try to execute your code in the code behind?
Are you sure you've got the correct control?
If you try to display the count of the items in a literal, does it work?

Best regards,
Boris Pocatko