I've got a structure of three nested repeaters to render out a tabs and then under those tabs a number of items grouped by headings. I've been using the strongly-typed data controls in .NET 4.5 successfully on standard IEnumerable
types but this is my first time with a Dictionary<T1,T2>
. Nonetheless I've seen another Stackoverflow question use a Dictionary
as the DataSource
successfully by declaring the ItemType
as KeyValuePair<T1, T2>
.
Markup:
<asp:Repeater ID="rptTabs" runat="server"
ItemType="System.Collections.Generic.KeyValuePair<System.String, System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<Sitecore.Data.Items.Item>>>">
<ItemTemplate>
<%# Item.Key %>
<%-- ... more repeaters under but they are commented out for now as it's the outer on that is failing --%>
</ItemTemplate>
</asp:Repeater>
Codebehind:
var myDatasource = new Dictionary<string, Dictionary<string, List<Item>>>();
// add some items
rptTabs.DataSource = myDatasource;
rptTabs.DataBind();
Here's the Exception/Stack trace I'm getting:
Appears as if the page can't be built because it can't resolve the ItemType by string
name. The thing is, I get intellisense on my <%# Item.Key #%>
so the intellisense engine can resolve the type by string name but the runtime can't?
Note: I doubt it's the Sitecore.Data.Items.Item
type failing as I've used it before inside an IEnumerable meaning the ItemType was Sitecore.Data.Items.Item
.
Any help would be appreciated!