10-25-05 10:52 PM
Hi,
I am trying to databind a ChannelCollection to a repeater control but I
think I am expecting it to be far to easy.
Channel collection:
public static ChannelCollection GetSubChannels(Channel c)
{
ChannelCollection cc = null;
if (c != null)
{
cc = c.Channels;
}
return cc;
}
Repeater Html:
<asp:repeater id="SectionMenu" runat="server">
<HeaderTemplate>
head HTML
</HeaderTemplate>
<ItemTemplate>
<Li>
<%# DataBinder.Eval(Container.DataItem, "DisplayName") %>
</Li>
</ItemTemplate>
<FooterTemplate>
foot HTML
</FooterTemplate>
</asp:repeater>
DataBind:
Guid g = GetRootNavGuid(thisUrl);
Channel c = Functions.Channels.GetChannelByGuid(g);
ChannelCollection sc = Functions.Channels.GetSubChannels(c);
sectionMenu.DataSource = sc;
sectionMenu.DataBind();
Any suggestions?
Thanks
[ Post a follow-up to this message ]
|